Github 提交标签以进行版本控制
我们有一个 Github 存储库,其中有一个分支“master”,代表我们代码库的稳定版本。
我希望能够在代表“版本”号的特定提交上使用“标签”进行提交,就像我看到人们所做的那样。
我们使用“SmartGit”与系统交互,因此当我在本地版本中创建新的“标签”时,我使用“Push Advanced”在服务器上创建新标签。
但是,没有显示代表我对标签的特定更改的提交注释,我担心我没有正确提交到特定的“标签”并且不想覆盖'master' 分支,其中提交了旧版本代码(早期版本)中的错误修复。
任何人都在 Github/SmartGit 中使用标签完成了这种交错版本控制
We have a Github repo with a single branch 'master' representing stable versions of our code-base.
I want to be able to commit with 'tags' on specific commits that represent 'version' numbers as I've seen people doing.
We use 'SmartGit' to interact with the system, so when I create a new 'Tag' in the local version, I use 'Push Advanced' to create a new tag on the server.
However, none of the commit notes representing my specific changes to a tag are being displayed, and I'm worried that I'm not correctly committing to a specific 'tag' and don't want to overwrite the 'master' branch with a commit of a bugfix in an older version of the code (earlier version).
Anyone done this sort of staggered version control with tags in Github/SmartGit
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将标记放在(一个)特定提交上,但不能对标记进行“提交”。
您正确地将 SmartGit 的高级选项推送到远程。
但要警惕 SmartGit 能够标记的提交:根据其文档,它只标记当前提交。
这意味着您必须先签出所述提交,然后再对其进行标记。
You can put a tag on a (one) specific commit, but you cannot make "commits" to a tag.
You correctly push through the advanced options of SmartGit that tag to the remote.
But be wary of what commit SmartGit is able to tag: according to its documentation, it only tags the current commit.
That means you have to checkout said commmit first, before tagging it.
标签是人类可读的指针,指向项目的某些特定版本;因此它们是不可变的。你不能在“标签上”创建提交——Git 不允许这样做。
您可以做的是为给定标签创建维护分支,并进行处理。例如,如果您使用
v1.3
标记最后一个稳定版本,则可以创建v1.3.x
分支,仅用于维护(错误修复);您将在那里创建v1.3.1
标签等。Tags are meant as human readable pointer to some specific version of a project; therefore they are immutable. You cannot create commit "on tag" -- Git won't allow it.
What you can do is to create maintenance branch for a given tag, and work on that. For example if you tagged last stable release with
v1.3
, you can createv1.3.x
branch for maintenance (bugfixes) only; you would create therev1.3.1
tags etc.