Git - 同時 push 到多個 remote


倘若 Repository 中有多個 Remote 而且希望一次 push 操作同時丟到多個 Remote 上,可以輸入以下指令來編輯 config :

$: git config -e

先前你如果已經設定好偏好的編輯器,則會使用設定好的編輯器進行編輯。在檔案下方建立一個新的 Entry ,例如:

[remote "all"]
    url=ssh://user@server/repos/g0.git
    url=ssh://user@server/repos/g1.git

然後 push 改指定 all 這個 Remote 名稱,就會發現同時丟往這兩個位置了!

留言

這個網誌中的熱門文章

Heroku + Bootstrappers 快速佈署

php/symfony - 在 ubuntu 執行 composer install 出現 "ext-curl *", "ext-gd *", "lib-icu" 的相依錯誤訊息