一见

git之tag操作

  • 查看本地有哪些 tags
# git tag -l
v0.0.3
v0.0.5
v0.0.6
  • 查看远程有哪些 tags
# git ls-remote --tags
From https://github.com/eyjian/gomooon.git
1fe7f5ecf369cba34f4328285ce1ec72d62c091e        refs/tags/v0.0.3
9371db55046109d7fc9a9f75625d5ec31c326ad1        refs/tags/v0.0.5
bw1vb29umqswcqydvqqldajzatenmasga1ueawwe        refs/tags/v0.0.6

命令格式:

git ls-remote --tags <remote_name>

将 <remote_name> 替换为远程仓库的名称,通常为 origin 。

  • 删除本地的 tag
git tag -d v0.0.6

命令格式:

git tag -d <tag_name>
  • 删除远程的 tag
git push origin :refs/tags/v0.0.6

命令格式:

git push <remote_name> :refs/tags/<tag_name>

将 <remote_name> 替换为远程仓库的名称,通常为 origin 。

posted on 2024-05-11 09:24  -见  阅读(1)  评论(0编辑  收藏  举报

导航