我们是两个人在尝试使用Bitbucket上的Git。开发人员使用简单的标签来跟踪所有提交 - 而QA人员正在尝试根据标签拉取新代码。
因此,开发人员决定:
错误信息为:
因此,开发人员决定:
git commit -v -am "($date) $comments"
git tag -a version-1 -m "($date) $comments"
git push --tags
这位QA同事做了什么
git clone <path> ; cd $dir
git checkout tags/version-1
第一次执行时,这样做是必要的 - 但第二次执行 - 对于更新标签 - 它会给出错误消息。
首次进行QA测试。
check out is successful with message
Note: checking out '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
它已经通过了 - 我们可以在代码库中看到新的标签和更改。
质量保证工程师进行了他的更改。
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目录?