【发布时间】:2016-06-12 00:02:22
【问题描述】:
我们有 2 个人试图在 bitbucket 上使用 git。开发人员正在使用简单的标签来跟踪所有提交 - 质量检查人员正试图根据标签提取新代码。
所以开发人员决定
git commit -v -am "($date) $comments"
git tag -a version-1 -m "($date) $comments"
git push --tags
质量检查人员做到了
git clone <path> ; cd $dir
git checkout tags/version-1
这是第一次需要的 - 但第二次 - 对于更新标签 - 它会给出错误消息。
第一次做质量检查
-
签出成功并显示消息
注意:检查 'tags/version-1'。
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> HEAD is now at 0c3514c... (02-28-2016) test comments
然后开发人员做了他的改变,然后做了
git commit -v -am "($date) $comments"
git tag -a version-2 -m "($date) $comments"
git push --tags
它通过了 - 我们可以在 repo 上看到新标签 - 有变化。
QA 人员进行更改
git checkout tags/version-2
错误信息是
error: pathspec 'tags/version-2' did not match any file(s) known to git.
但是
如果 QA 这样做
git clone <path> ; cd $dir
git checkout tags/version-2
效果很好!!! QA 人员如何使用开发人员检查的新标签更新同一个 git 主管?
【问题讨论】: