How to update all local branches with git?
过去多啦不再A梦
过去多啦不再A梦 2017-05-02 09:36:43
0
2
994

I thought

git pull --all
# 或
git fetch --all

Just update all branches. I just read the manual and it turns out that this --all updates this branch from all remote repositories.

I have develop, master, feature-xxx locally and these branches are all associated with the remote warehouse.
What should I do if I want to fetch or pull download all branches from the server at once?

过去多啦不再A梦
过去多啦不再A梦

reply all(2)
阿神

I wrote a script myself. Contribute.

git branch | awk 'BEGIN{print "echo ****Update all local branch...@daimon***"}{if(=="*"){current=substr(rrreee,3)};print a"git checkout "substr(rrreee,3);print "git pull --all";}END{print "git checkout " current}' |sh
我想大声告诉你

For details, please see:

Can “git pull --all” update all my local branches?

There should be no native solution, or Git itself does not have such a function?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template