简体   繁体   中英

Git pull for all branches in local repository

看似git pull只为当前分支进行获取和合并,是否有一种简单的方法可以为本地仓库中的所有分支pull

Try this

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

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM