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的版本之后修改的)

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.删除远程标签

git push origin --delete tag 版本号

6.删除本地标签

 git tag -d 版本号
posted @ 2015-05-25 11:23  BaronZ  阅读(307)  评论(0编辑  收藏  举报