1

I notice the following during the pipeline build stage for my git branch. I however get no 'HEAD DETACHED' error when I checkout the branch in my dev environment. Is this error significant or is it just something that is to be expected for all git based pipeline builds on Azure DevOps?

Note: switching to 'd1be2f5491ae7fbb40fc7ec095c4be44b4120dc5'.

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 switching back to a branch.

If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command. Example:

git switch -c

Or undo this operation with:

git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at d1be2f5 Update azure-pipelines.yml for Azure Pipelines

Chubsdad
  • 24,777
  • 4
  • 73
  • 129

2 Answers2

2

That's not an error, which is why it's not reported as an error, doesn't appear with scary red text, and doesn't stop the build.

It is expected behavior.

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
1

It is an expected behavior, a kind of temporary Git state. For our project it corrupted the build info we keep in binary, we lost the branch information. Starting the build pipeline with

git checkout <branch>
git pull

fixed that. Wonder why pull is necessary, otherwise it's 1 commit behind HEAD.

Jeremitu
  • 121
  • 1
  • 4