2010-08-21 105 views

回答

7

git push --mirror <origin>將使遠程的引用匹配本地存儲庫中的引用,包括刪除本地沒有的分支。

git help push

--mirror 
    Instead of naming each ref to push, specifies that all refs under 
    refs/ (which includes but is not limited to refs/heads/, 
    refs/remotes/, and refs/tags/) be mirrored to the remote 
    repository. Newly created local refs will be pushed to the remote 
    end, locally updated refs will be force updated on the remote end, 
    and deleted refs will be removed from the remote end. This is the 
    default if the configuration option remote.<remote>.mirror is set.
1

您可以刪除遠程分支機構我推空分支:

$ git push origin :branch-to-delete 
+0

因爲有超過5家分行......我覺得這種方式是低效的是爲什麼我要尋找其他選擇。 – xenoterracide 2010-08-21 06:35:45

相關問題