开发者

git - what have I done?

开发者 https://www.devze.com 2022-12-13 03:42 出处:网络
I did: git clone git://github.com/xyz/xyz.git git tag -l release-1.0.0 release-1.0.1 release-1.0.2 git checkout release-1.0.2

I did:

git clone git://github.com/xyz/xyz.git  
git tag -l  
 release-1.0.0  
 release-1.0.1  
 release-1.0.2  
git checkout release-1.0.2  
git开发者_高级运维 checkout -b xyzfilter  

and now I think that I have a new branch, called xyzfilter, based on the tag 'release-1.0.2'.

Did I do this correctly ?


Yes, that looks correct, assuming that there weren't any major errors in the execution of any of the commands.

If release-1.0.2 is a tag rather than a branch (which it must be for this to work after a straight clone), then this creates a 'detached HEAD' and checks out the version at the tag.

git checkout release-1.0.2

Then this command creates a new branch based on the currently checked out version (i.e. the tag that was just checked out) and switches to the new branch.

git checkout -b xyzfilter
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号