azure-devopsgit-detached-head

Detached Head while building pipeline on Azure DevOps


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


Solution

  • 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.