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
$ git push origin master
$ git fetch
$ git merge
fatal: No commit specified and merge.defaultToUpstream not set.
$ git merge [< commit >..]
< commit >
< refspec >
< commit >
Usually you do not invoke
git merge without arguments (at least I don't know anyone who does). If you want that
merge defaults to the tracking branch, you need to set
merge.defaultToUpstream to true:
git config merge.defaultToUpstream true. Your
master branch has to track
origin/master in this case:
git branch --set-upstream master origin/master. This is done automagically if
origin/master was already present when you cloned.
Personally, I do
git fetch and then
git merge origin/master or
git pull if I have no local commits.
Edit: As VonC mentioned
merge.defaultToUpstream defaults to
true since Git 2.0.