Friends,
我现在厌倦了 Azure DevOps/VSTS。 Jenkins 好多了,现在仍然如此,只是我的组织想要使用 Azure DevOps。
我有一个谜团需要帮助来解决。
以下是我的笔记本电脑上的存储库,它没有未跟踪或未提交的更改。
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
构建管道的签出阶段如下所示:
如何解决这个问题?我不应该结帐吗?或者应该修改构建管道中的配置设置之一?
这就是 Azure DevOps Pipelines 的设计方式。
如果您仍然需要签出“该”分支(或任何其他特定分支),您可以添加一个任务:
- task: CmdLine@2
displayName: Checkout $(Build.SourceBranchName)
inputs:
script: 'git checkout $(Build.SourceBranchName)'
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)