2013-11-25 30 views
0

如何在Git中刪除遠程標籤,當有歧義的名稱與分支名如何刪除git的遠程標籤,當有歧義的名稱與分支名

$ git push origin :refs/tags/<tag name> 
Enter passphrase for key '/c/Users/xxxxxxx/.ssh/id_rsa': 
remote: Branch refs/tags/<tag name>: 
remote: You need 'Push' rights with the 'Force Push' 
remote: flag set to delete references. 
remote: User: xxxxxxx 
remote: Please read the documentation and contact an administrator 
remote: if you feel the configuration is incorrect 
remote: Processing changes: refs: 1, done 
To ssh://[email protected]:xxxxxxx/xxxxxxx.git 
! [remote rejected] <tag name> (cannot delete references) 
error: failed to push some refs to 'ssh://[email protected]:xxxxxxx/xxxxxxx.git' 

請幫我在對此。在這裏,我想要刪除的標籤名稱與我想要保留的某個分支相同。

+0

你做的一切都正確。 'refs/tags /'前綴應該消除名稱的歧義。真正的問題在Poke的答案中有描述。 –

回答

1

遠程存儲庫會阻止您刪除引用。它在錯誤消息中是這樣表示的:「您需要'推送'權限,'強制推送'標誌設置爲刪除引用。」

Git的標籤也是引用,就像這就是爲什麼在遠程推送或刪除它們時沒有什麼區別。

相關問題