On Fri, Jan 13, 2012 at 12:29:49PM -0800, ruperty wrote: > Being new to git I am probably not doing things correctly so pointers in the > right direction would be useful. > > What I want to do make changes on my laptop and commit them to a remote > repository. Here is what I have done, > > 1. Created a repository on my remote linux host, in a folder of cource code, > by, > > git init > git add * > git commit > > 2. On my laptop I did a git clone pointing by ssh to the remote repo which > downloaded all the files to my local system. > > 3. I changed a file locally and did a commit. > > 4. I then wanted to update the remote repo with my change, which I did with > a git push, but that didn't work, getting this error, > > remote: error: refusing to update checked out branch: > refs/heads/master[K > remote: error: By default, updating the current branch in a non-bare > repository[K....... > > > What am I doing wrong? You're trying to push to a non-bare repository and change the currently active branch, which can cause problems, so git isn't letting you. There's an explanation of bare and non-bare at http://bare-vs-nonbare.gitrecipes.de/ but the short and sweet is that you should init the repo you want to use as the central point with --bare and do modifications locally and then push there. cmn
Attachment:
signature.asc
Description: Digital signature