git tag

1.建立標籤

git tag -a 版本號 -m '版本註釋version 1.0'

2.提交標籤

git push --tags

3.獲取標籤

git checkout 版本號

(此時會有下面的提示,大意是你能夠作實驗性修改,不會影響到其餘人獲取這個版本。這些修改push不了,若是你要保存這些修改而且push,能夠建立一個分支去push:git checkout -b new_branch_name, 這些修改是在checkout的版本以後修改的)git

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

4.查看標籤

git tag

5.刪除遠程標籤this

git push origin --delete tag 版本號

6.刪除本地標籤spa

 git tag -d 版本號
相關文章
相關標籤/搜索