The last couple of weeks one of our Visual Studio Online git repository refused to get pulled by simply hitting „sync“ inside VS. It always said:

„An error occurred. Detailed message: An error was raised by libgit2. Category = Merge (Error).
Invalid description in FETCH_HEAD line 61“

As this was obviously a libgit2 error, it was still possible to pull and push via git bash. So we were not out of business, but it was not nice.

Looking into the error we noticed that our .git/FETCH_HEAD contained a branch name in line 61.

Turn out the branch name was „wip/1637-unify_errand’s_services/main“ which included a ‚ character in the branch name. This was the root cause of the error – so we simply deleted that branch and everything started working again.