【发布时间】:2019-02-05 06:25:56
【问题描述】:
朋友们,
我现在厌倦了 Azure DevOps/VSTS。 Jenkins 好多了,现在仍然如此,只是我的组织想要使用 Azure DevOps。
我有一个谜团需要帮助解决。
以下是我笔记本电脑上的 repo,它没有未跟踪或未提交的更改。
git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
git remote -v
origin https://github.com/xxx/terraformvsts.git (fetch)
origin https://github.com/xxx/terraformvsts.git (push)
猜猜看,Azure Devops 在每次构建执行时总是抱怨它有 "DETACHED HEAD" 。
请注意“结帐”阶段的以下内容:
2019-02-05T05:55:33.2076875Z Note: checking out 'aad90fceecf39a7731c356ebfe2b547ddbce99e6'.
2019-02-05T05:55:33.2076992Z
2019-02-05T05:55:33.2077872Z You are in 'detached HEAD' state. You can look around, make experimental
2019-02-05T05:55:33.2077939Z changes and commit them, and you can discard any commits you make in this
2019-02-05T05:55:33.2078179Z state without impacting any branches by performing another checkout.
2019-02-05T05:55:33.2078345Z
2019-02-05T05:55:33.2078389Z If you want to create a new branch to retain commits you create, you may
2019-02-05T05:55:33.2078683Z do so (now or later) by using -b with the checkout command again. Example:
2019-02-05T05:55:33.2078717Z
2019-02-05T05:55:33.2078933Z git checkout -b <new-branch-name>
2019-02-05T05:55:33.2078966Z
2019-02-05T05:55:33.2079004Z HEAD is now at aad90fc Clean Repository
Build pipeline 的 checkout 阶段如下:
如何解决这个问题?我不应该结帐吗?还是应该修改构建管道中的配置设置之一?
【问题讨论】:
-
就像答案一样,这是 Azure DevOps 构建的行为。问题是什么?为什么对你不好?
-
我也不喜欢。它不直观,一些合作伙伴也不知道这一切,也不灵活。微软的方式很复杂,而且充满了不必要的步骤。更不用说高级的东西仅限于它们的外壳,它只能在 Windows 上运行。
标签: git github azure-devops