What & How & Why

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
software_dev:ver_ctrl:git [2023/12/15 00:45] – [Taging] codingharesoftware_dev:ver_ctrl:git [2023/12/15 00:53] (当前版本) – [Tagging] codinghare
行 212: 行 212:
 # switch to the branch before tagging # switch to the branch before tagging
 git tag <tag_name> git tag <tag_name>
 +
 +# listing exsiting tag
 +git tag
 +
 +#deleting tag
 +git tag -d <tag_name>
 +
 +#deleting tag on origin
 +git tag -d <tag_name>
 +git push origin :refs/tags/<tagname>
 </code> </code>
 默认的 tag 是关联到当前分支的**最新** commit 上的。如果希望对指定的 commit 打 tag (比如忘记打了),需要加上 commit id: 默认的 tag 是关联到当前分支的**最新** commit 上的。如果希望对指定的 commit 打 tag (比如忘记打了),需要加上 commit id:
 <code bash> <code bash>
 git tag <tag_name> <commit id / 7 digits> git tag <tag_name> <commit id / 7 digits>
 +
 +# creating tag with extra message
 +git tag <tag_name> -m "your message here" <commit id>
 +
 </code> </code>
 打好 tag 以后就可以很方便根据 tag 查看 commit 了: 打好 tag 以后就可以很方便根据 tag 查看 commit 了:
 <code bash> <code bash>
 git show <tag_name> git show <tag_name>
 +</code>
 +tag 默认存在本地。如果要推送到远程,使用以下命令:
 +<code bash>
 +git push origin <tag_name>
 +
 +#push all tags at once
 +git push origin --tags
 </code> </code>
 ===Teamwork=== ===Teamwork===