I'm using Visual Studio 2022 Community.
I have only used Source Control in Visual Studio once. I decided to use it again, following this tutorial.
I created a simple solution that has nothing but Hello World console app. I clicked Add to Source Control
then Git
. I made sure to sign in via GitHub to Visual Studio. Here are the settings:
So I clicked Create & Push. I look at my GitHub profile, and yes, the repository has been created.
However, when I look at the commits after creating the repository, they don't have a user profile and are all titled "User", suggesting that those are ghost users:
Then I decided to create a new file named TextFile.txt directly via the github.com website. It works, and I also see my profile picture and username displayed in the commit:
Can anyone explain why the commits are broken when I use Visual Studio 2022 even though I signed in to Visual Studio via my GitHub account, but they aren't when I commit/change a file/add a file directly via github.com?
Any help would be appreciated.
I was not able to find anything like this on the internet.
Your observation can be reproduced by configuring git to use the username "User".
Use git config --list
to view your current settings.
git config --global user.name "Your name"
git config --global user.email youremail@email.com
Github documents the need to configure git here.
These values can be overwritten in your repository settings.