I have added this: git config --global pull.default current
But when I do git pull
I get all the branches from the origin
remote. How can I make the default to work for git pull
?
I have added this: git config --global pull.default current
But when I do git pull
I get all the branches from the origin
remote. How can I make the default to work for git pull
?
If you want to fetch only the current branch, you need to specify it, since there is no pull.default policy (only push policies).
If your branch has an upstream branch
git fetch $(git rev-parse --symbolic-full-name --abbrev-ref @{upstream} | sed 's!/! !')
Note that git pull
already pull (meaning merge) only the current branch (but fetches and then update all remote tracking branches)
You could also change the refspec of the origin to always fetch one branch, but that would not be the "current" one.