Git 使用 bamboo 时重新标记后链接到旧提交的标签
Git label linked to old commit after relabel when using bamboo
我在使用标签检查提交时遇到问题。
我已经提交并标记了提交 1.0
。我不得不做一些变基,以结束改变我历史上的一些提交,这导致我需要在新提交上重新标记 1.0
标签。当我使用 git checkout 1.0
手动检出标签时,新提交被检出并且效果很好。有一种情况是检出标签最终指向旧的提交......这种情况是当我使用 python 脚本执行 git 检出并且我有从 Bamboo 调用的脚本Atlassian 作业。
有谁知道可能导致历史记录不更新的原因吗?请注意,竹作业每次都会清理它的环境。
一种可能是您 not deleted/push back the tag 刚搬到本地。
git push origin :refs/tags/<tagname>
git tag -fa <tagname>
git push origin master --tags
如果推送,Bamboo 作业将能够获取然后签出 1.0
标记的正确提交。
OP tyleax adds :
I needed to do one more step.
Bamboo remote agents cache the git repository information. I had to delete the cache in xml-data/build-dir/_git-repositories-cache
on the next checkout it was able to checkout the correct commit via label.
Without deleting, it was still pointing to the old commit
我在使用标签检查提交时遇到问题。
我已经提交并标记了提交 1.0
。我不得不做一些变基,以结束改变我历史上的一些提交,这导致我需要在新提交上重新标记 1.0
标签。当我使用 git checkout 1.0
手动检出标签时,新提交被检出并且效果很好。有一种情况是检出标签最终指向旧的提交......这种情况是当我使用 python 脚本执行 git 检出并且我有从 Bamboo 调用的脚本Atlassian 作业。
有谁知道可能导致历史记录不更新的原因吗?请注意,竹作业每次都会清理它的环境。
一种可能是您 not deleted/push back the tag 刚搬到本地。
git push origin :refs/tags/<tagname>
git tag -fa <tagname>
git push origin master --tags
如果推送,Bamboo 作业将能够获取然后签出 1.0
标记的正确提交。
OP tyleax adds
I needed to do one more step.
Bamboo remote agents cache the git repository information. I had to delete the cache in
xml-data/build-dir/_git-repositories-cache
on the next checkout it was able to checkout the correct commit via label.
Without deleting, it was still pointing to the old commit