Remove my local PC username from github repo

Hello,

When i push to GitHub from local, the repo has my PC username listed, as striked-out in the pic.
I understand this must be taken from my local cli window from where i sent the push, which has my windows username. Anyone know how to change this?

If I can’t for this repo, how do i avoid this in future and use my GitHub username instead?
Thank you.

For future commits, you need to set your name in the git setting, and if you haven’t done that yet you’ll most likely need to set your email address, too. The following links describe how to do that:

I see in the screenshot that you have just one commit in your repository, so to fix the user name and email you can just use the following command:

git commit --amend --reset-author

And then force-push to Github.

For repositories with more commits you’ll have to rewrite history to change author information, but heed the warning.

I changed just my username as suggested in the first link, and it changed to my github’s username in the repo, regarless of what local username i had given both globally & project specific. Maybe this is anyway overridden by “owner” setting while creating a new git from web ui.

git commit --amend --reset-author

As for this command threw dir permission denied error (i confirm i was in the right working dir, and other edit tasks to this project works fine without dir permission issues) before opening vim, and i wasn’t sure how to change author name as it allowed to edit only the commit name.

However, this is fine as I’m okay with my github username as author. As I’m already saddled with issues in the project, I’d focus on that right now than wanting to have my custom author name. :upside_down_face:

Thank you. for your help.

1 Like

Yes, that correct, Github will show your Github username as the author of commits where the author mail address is associated with your account. That’s just a UI thing, anyone who clones the repository and runs git log will see whatever you configured.

If you create commits over the web UI it’ll use your display name as the author, yes. The settings on your computer don’t matter for the Github servers. :wink: