VSTS Git Fetch Failed with exit code: 128

In my case the error was caused by a change in permission settings in Version Control. I went to the gear icon --> project settings --> Version Control. I selected Git repositories on the left and under users i made sure to include 'Project Collection Build Service(project)'

enter image description here


I recently came across this issue and after several tries what worked for me is a check box for "Checkout Files from LFS" while adding the artifacts to Azure release/pipeline. Here

enter image description here


Another possible cause of the "Git fetch failed with exit code: 128" error message - it happened to us for pull requests builds when a developer clicked merge right after a pull request was created and the build, of course, hasn't finished yet.

So it was the "follow the process" solution for us. It could be enforced also.


For anyone who finds this question, while searching for the 128 exit code:

In my case it was Bitbucket Server running out of space (full hard drive) which caused this error. If you're hosting your git server yourself, check your hard drive:

df

Maybe that helps someone.