If I set display_user:true inside my oh-my-posh theme json file (spaceship.omp.json), I can see my windows account name. I want to know If I can do the same for git username.

1

There are 1 best solutions below

0
Pepe Doval On

Git will use the config for user.name and user.email when creating commits. You can retrieve see their current values with:

git config user.name
git config user.email

Note that those configs can be just defined in your personal .gitconfig file (the usual) or they can be defined in a global system .gitconfig or redefined in a project .gitconfig, so you can have different values for different repositories.

Also note that these config values are what git will use to commit or sign your work, but not necessarily which github account will be used. That'll be determined by how the remote has been configured, as the remote server will typically identify you by your SSH keys, in which case git will use any key installed usually in ~/.ssh that you have added to your github account.