2014-01-17 51 views
0

我有一個「Heroku」和「Codebase」存儲庫,每次我推,它只會更新「Heroku」。我如何將「Codebase」Repository添加到我的git配置中並更新兩者?我應該使用 git remote add alt name [email protected]:myproject.git我嘗試'推'和'推送起源'主,也注意到我的:git config -e沒有代碼基路徑。Git同時推送到heroku和codebase

謝謝!

回答

0

是的,首先你應該也做添加其他庫:

$ git remote add alt-name [email protected]:myproject.git 

然而git-push只推到一個回購的時間,但你總是可以這樣做:

$ git push origin && git push alt-name 

如果您想要做一個單一的命令,你可以編輯項目的git配置,位於.git/config並添加:

[alias] 
    push-all = !git push origin && git push alt-name 

那麼你可以每次想要推送到這兩個存儲庫時只需要做一個$ git push-all