As a new git user, who is an expert with SVN and CVS, I am struggling to get the most basic of git functions to work.
I'm using a shared repo at assembla.com
I created a local clone, and added a file:
$ git clone repository-url
$ echo "hello" > ha.txt
$ git add -A
$ git commit -a -m "haha"
$ git push
NOTE: at this point I got "No refs in common and none specified; doing nothing" error. After some hours googling, I found the solution was to type this
$ git push origin master
Then I went onto another computer, modified the file, and commit-ed it (surprisingly, I didn't need to do the git push origin magic). Then I back to the main computer, modified it again, so I could see how merge works.
$ git fetch
$ git merge
Now I get the error:
fatal: No commit specified and merge.defaultToUpstream not set.
Looking at the man page for "git merge", you have to specify something like this:
$ git merge [< commit >..]
The problem is, I cant find out what < commit >
means, and what it should be. E.g. should it be a file, a repo, a message, a version?
I have not created a branch - I'm just working on the "head" or master as I think git calls it
Unfortunately, google is not much help on this one. The man pages seem to expect you to know what a < refspec >
, < commit >
and origin
are.
Any help on this noob problem appreciated.