zgpmax zgpmax - 1 year ago 98
Git Question

What does 'git merge' with no arguments do?

I've seen people doing

git merge

i.e. using "git merge" with no arguments. It looks like it might do something useful. But I couldn't find documentation for this scenario on git-scm.com.

What does "git merge" do in this scenario?

Answer Source

It would try and merge its upstream branch (git merge)

If no commit is given from the command line, merge the remote-tracking branches that the current branch is configured to use as its upstream.

So check, to see if a branch has an upstream repo associated to it:

git config remote.$(git config branch.$(git symbolic-ref --short HEAD).remote).url

This uses:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download