It looks like a duplicate of this question but my issue is that I am running a hosted version. VSTS GIT Fetch Failed
I enabled system debug and pretty much allowed a
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.
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.
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)'