Fix: Visual Studio 2022 message - Git failed with a fatal error - Permission denied

Fix: Visual Studio 2022 message - Git failed with a fatal error - Permission denied

This post is in the category of “I’ll record it here so that the next time I run into it, I can remember what it was”. And if it helps anyone else in the meantime, that’s a bonus.

I had configured a new repository in Azure Repos (as part of Azure DevOps), cloned it to a local copy, modified some files and tried to push them back to the repo.

I received the error shown.

The Issue

What wasn’t immediately obvious to me was that it wasn’t a permission issue, it was an issue with pushing that .vsidx file that’s used as a file content index.

The actual problem was that I normally have it excluded in my .gitignore file. Once I’d added the .gitignore file to the folder, all was good.

Hope that helps someone.

2024-09-25