nanoquack
nanoquack

Reputation: 969

git pull from branch complains about which branch to merge with

When I am not on the master branch, git sometimes complains

"You asked me to pull without telling me which branch you want to merge with, and 'branch.basics.merge' in your configuration file does not tell me, either. Please specify which branch you want to use on the command line and try again (e.g. 'git pull '). See git-pull(1) for details."

Just wondering if it is possible to configure git so it does always merge with the associated remote branch from origin. As an example: If I am at branch basics (which I currently am ;-) ) and I make a git pull. Now I want git to fetch this branch from origin and merge it with the same local branch.

Cheers, Rudolf

Upvotes: 1

Views: 306

Answers (1)

VonC
VonC

Reputation: 1324673

You can specify the upstream branch (see "How do you make an existing git branch track a remote branch?"):

git branch --set-upstream basics origin/basics

Or, the first time you push your branch (see "Git: Why do I need to do --set-upstream all the time?"):

git push -u origin my_branch

Upvotes: 5

Related Questions