您好,欢迎来到二三四教育网。
搜索
您的当前位置:首页git 获取tags

git 获取tags

来源:二三四教育网

Say you have a project and have been tagging particular points of it on the command line using

git tag -a v1.0 -m 'tagging Version 1.0'

Sometime later you’d like to go back to such a tag. This is how we can do that.

First, commit your current changes so that you’re free to checkout anything new without losing your hard work. Then simply type

git checkout tags/v1.0

assuming that v1.0 is the name of your tag. Sometimes you may want to checkout this tag and create a new branch while you’re at it, so that your current branch won’t be overwritten. Thankfully we can do this by issuing

git checkout tags/v1.0 -b NewBranch

This will create a new branch called NewBranch and checkout tag v1.0. Once you’re done working on it you can go back to another branch (for example master) by issuing

git checkout master

Notice that to switch to other branches you only need to give the branch name – unlike with tags which need to be prefixed with ‘tags/’ as shown above.

打赏

如果这篇文章解决了您的问题,让我买根烟抽抽。

支付宝.jpg 微信.jpg

Copyright © 2019- how234.cn 版权所有 赣ICP备2023008801号-2

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务