Azure pipeline - error: pathspec 'main' did not match any file(s) known to git

25 Views Asked by At

I do get following error when running a release pipeline with maven-release plugin in background:

Starting: Reattach detached head 
============================================================================== 
Task : Bash 
Description : Run a Bash script on macOS, Linux, or Windows 
Version : 3.227.0 
Author : Microsoft Corporation 
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/bash 
============================================================================== 
Generating script. 
Script contents: 
git checkout main 
========================== Starting Command Output =========================== 
/usr/bin/bash /agent/_work/_temp/b44c1c2b-b722-4d90-a662-570bb11df3cb.sh 
error: pathspec 'main' did not match any file(s) known to git 
##[error]Bash exited with code '1'. 
Finishing: Reattach detached head 
1

There are 1 best solutions below

0
Splioo On

I had to remove the check from Shallow Fetch in Pipeline Configuration: enter image description here