简体   繁体   English

标记git repo?

[英]Tagging a git repo?

I am new to git (been using svn and mercurial for awhile). 我是git的新手(暂时使用svn和mercurial)。 Is there a way to 'tag' my git repository? 有没有一种方法可以“标记”我的git存储库? Something like tagging it "version 12, removed red square.". 例如将其标记为“版本12,删除了红色方块”。 I'd like to pull the source state at the time the tag was added, if I ever need to revert to a known snapshot of the code. 如果我需要恢复到代码的已知快照,我想在添加标签时提取源状态。 Is it possible? 可能吗? Would be cool, if a year from now, I'm looking through my repo and can see all my tags, and pull out the code at different states during development, 太好了,如果从现在开始一年后,我正在浏览我的仓库,可以看到我的所有标签,并在开发过程中以不同的状态提取代码,

Thank you 谢谢

The command is git tag , read about it with git help tag . 该命令是git tag ,请与git help tag一起阅读。

Next time use git help -a to find the obvious answer. 下次使用git help -a找到明显的答案。

Even if you don't have a tag, you can always go through git log , find the commit you're interested in, and git checkout (or git tag ) it. 即使您没有标签,也可以始终执行git log ,找到您感兴趣的提交,然后git checkout (或git tag )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM