James Taylor
James Taylor

Reputation: 365

How to resolve these errors "[error]Git checkout failed with exit code: 1" in tfs

How to resolve these errors in tfs

"error: pathspec 'refs/remotes/origin/master' did not match any file(s) known to git",

"[error]Git checkout failed with exit code: 1"

Upvotes: 0

Views: 4744

Answers (1)

VonC
VonC

Reputation: 1327184

This could be similar to Microsoft/azure-pipelines-tasks issue 2740, should you see something like:

##[command]git -c http.extraheader="AUTHORIZATION: bearer ********" fetch --tags --prune --progress origin 
##[command]git checkout --progress --force refs/remotes/origin/master 
  error: pathspec 'refs/remotes/origin/master' did not match any file(s) known to git. 
##[error]Git checkout failed with exit code: 1

I could be wrong, but I think it's because your Git repository is empty and might not yet have a master branch.
You can try queuing the job manually in Jenkins and you'll probably see the same error there.

Make sure your repo as at least one commit on the master branch.

Upvotes: 0

Related Questions