怎样git pull 所有的branches?

sh/bash/dash/ksh/zsh等Shell脚本
回复
huangyingw
帖子: 53
注册时间: 2008-03-05 21:42
送出感谢: 0
接收感谢: 0

怎样git pull 所有的branches?

#1

帖子 huangyingw » 2010-09-26 17:42

大家好,
假设我的[code]git branch -a[/code]的输出如下:
[code]*dev
gcb
gps
master
remotes/gh/dev
remotes/gh/gcb
remotes/gh/gps
remotes/gh/master
remotes/origin/dev
remotes/origin/gcb
remotes/origin/gps
remotes/origin/master
[/code]
我想递归地把所有的DEV都PULL在一起,所有的GPS都PULL在一起,比方说:git pull gh/dev into local dev, git pull origin/dev into local dev。等等。
怎么实现呢?
或者,GIT里面有没有什么现成的简单的解决方法?
wang0109
帖子: 2
注册时间: 2010-09-18 0:58
送出感谢: 0
接收感谢: 0

Re: 怎样git pull 所有的branches?

#2

帖子 wang0109 » 2010-10-11 11:48

git fetch origin


git pull is actually a git fetch followed by a git merge.

i guess what you want is a :
git fetch origin
git fetch gh
git merge origin/dev gh/dev

you could write a simple shell script to do that.
回复

回到 “Shell脚本”