Home > Net >  Publishing commits to GitHub not displaying Git history with Mac OS zsh?
Publishing commits to GitHub not displaying Git history with Mac OS zsh?

Time:11-21

Ditched Windows for Mac. Now, everytime I push a commit to GitHub I don't get credited with publishing history, despite being logged in to my GitHub acc as seen with gh auth login or gh auth status.

It credits the username of what the zsh is logged in as instead of my GitHub username.

CodePudding user response:

GitHub credits commits to accounts based on the email in the commits, which should be associated with the account in question. That is typically set in user.email in your Git config. If you have not set user.name, you should also set that, which should be set to a personal name, not a username, and which has no effect on authentication.

You can see what values have been set with git config --get-regex user.. You can also set one or more of these values with something like git config --global user.email [email protected]. You can also look at your commit logs with git log --format=full to see what's stored in them.

The information in the commits is unrelated to the authentication for pushes. It is possible to push commits created by other people with Git, and this approach is heavily used in some projects (e.g., Git itself).

  • Related