I tried to add my solution to the local repository by selecting File|Add to Source Control, but I got the following message.
This was happened with me a few months ago (on Visual Studio 2017). And following solved the issue :
Don't forget to check in case there is any .git folder in the project root folder.
Note : You'll loose the historical data.