2015-09-05 89 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 

推到两个回购

相关问题