在項(xiàng)目的管理中有時(shí)候備份的版本是太老或者備份的版本不對(duì)猎贴,就需要進(jìn)行刪除藕各。這里說(shuō)下git tag 刪除的操作娃兽。
git 刪除本地標(biāo)簽:
git tag -d 標(biāo)簽名
例如:git tag -d v3.1.0
git 刪除遠(yuǎn)程標(biāo)簽:
git push origin :refs/tags/標(biāo)簽名
例如:git push origin :refs/tags/v3.1.0
git 刪除本地模塊標(biāo)簽的操作
git submodule foreach git tag -d 標(biāo)簽名
例如:git submodule foreach git tag -d v3.1.0
刪除成功提示:
To http://XXXXXXXX_Master.git
- [deleted] v3.1.0
git 刪除遠(yuǎn)程模塊標(biāo)簽的操作
git submodule foreach git push origin :refs/tags/標(biāo)簽名
例如:git submodule foreach git push origin :refs/tags/v3.1.0
刪除成功的提示:
Entering 'XXXXXXXX'
To http://XXXXXXXX.git
- [deleted] v3.1.0
Entering 'XXXXXXXX'
To http://XXXXXXXX.git
- [deleted] v3.1.0
注意點(diǎn):有時(shí)候随抠,項(xiàng)目模塊是不允許刪除的,就會(huì)關(guān)于權(quán)限的一些error提示荸型。只要到管理者哪里添加權(quán)限就可以了盹靴。
如果對(duì)你有一點(diǎn)點(diǎn)幫助,那是值得高興的事。:)
我的csdn:http://blog.csdn.net/shenshizhong
我的簡(jiǎn)書(shū):http://www.reibang.com/u/345daf0211ad