2015-09-05 82 views
4

我想使用這些bash功能將我的本地倉庫推到兩個遠程倉庫,但我不確定這是否可行。我可以將本地倉庫推到兩個遠程倉庫嗎?

p_foo_0() { 
    git add -A . 
    git commit -m "test" 
    git push origin master 
    echo "success" 
} 

p_foo_1() { 
    git add -A . 
    git commit -m "test" 
    git push heroku master 
    echo "success" 
} 
+2

下面是做這件事 - HTTP:/ /stackoverflow.com/questions/14290113/git-pushing-code-to-two-remotes –

+0

這裏是舊的方式來做到這一點,它也包含了你pdated類似於上面的答案 - http://stackoverflow.com/questions/849308/pull-push-from-multiple-remote-locations –

回答

2

配置的遙控器使用:

git remote set-url all --push --add <first-repo> 
git remote set-url all --push --add <second-repo> 

現在你可以使用:

git push all master 

推到兩個回購

相關問題