Sunday, July 8, 2012

Git: Configuring Default Pull/Push Remote Branch

While this is automatically done when you clone from a remote repository, you'll have to configure this yourself when you're the one who shared the repository/branch in the first place.

You'll know you have this problem when you see this error message:

> git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me, either.


The solution is to add the following (e.g. master branch) to the ".git/config" file.

[branch "master"]
       remote = origin
       merge = refs/heads/master

No comments:

Post a Comment