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?

jub0bs
  • 54,300
  • 24
  • 162
  • 166
Thomson
  • 19,332
  • 23
  • 82
  • 128
  • 2
    Does this help? http://stackoverflow.com/questions/4318161/can-git-pull-all-update-all-my-local-branches – jmargolisvt Jun 13 '15 at 04:07
  • Possible duplicate of [Can "git pull --all" update all my local branches?](https://stackoverflow.com/questions/4318161/can-git-pull-all-update-all-my-local-branches) – krlmlr Apr 15 '19 at 19:38

2 Answers2

2

Try this

for remote in `git branch -r`; do git branch --track $remote; done
git fetch --all
git pull --all
Shreeram K
  • 1,654
  • 11
  • 21
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.

Rahul Gupta
  • 43,515
  • 10
  • 102
  • 118