1

Seemingly git pull does fetch and merge only for the current branch, is there an easy way to pull for all branches in local repo?

2

2 Answers 2

2

Try this

for remote in `git branch -r`; do git branch --track $remote; done
git fetch --all
git pull --all
1

You can use git-up for this. It will automate the process of fetching and rebasing all locally-tracked remote branches. You don't have to type multiple commands again and again. You can achieve this in a single command.

Installation:

gem install git-up

Usage:

git up

This command will then fetch and rebase all the locally-tracked remote branches automatically.

gitup

For more configuration options with git-up, check out this link.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.