Developer
Developer

Reputation: 2321

Git commits with the incorrect name

I have a personal account on GitHub and an organization. But my recent project is a personal project and not owned by my organization. Unfortunately my last commit is owned by my organization. I tried to change my name (git config --global user.name "YOUR NAME"). But there's everything right. Why does Git commit with my organization name and how do I change this?

Upvotes: 1

Views: 977

Answers (2)

Sajib Khan
Sajib Khan

Reputation: 24156

Check if you change user.name for the repo (git config --local ...).

$ git config --list
# Find 'user.name' and 'user.email'

Change Commit Author:

$ git commit --amend --author "New-author-name <[email protected]>"
$ git push -f origin HEAD

Upvotes: 2

Amita
Amita

Reputation: 974

Go to your settings in GitHub and add your organization email address there, under the Emails tab. This way you will get all your work committed under your organization name displayed there.

Change your user name and user email using command

git config --global user.name "name"
git config --global user.email "email-address"

Upvotes: 1

Related Questions