Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Can I change commit author?

I'm a novice, and I need to correct the author name in my initial commits.  I'm reading the excellent Bitbucket documentation, particularly the chapter on "undoing changes", but nothing seems to work: No matter what I try, the commits with the bad author name remain in my local file and also in the Bitbucket file If there is no way to fix this, can I just start over from scratch?

1 answer

0 votes
Mikael Sandberg Community Leader Sep 03, 2020

Hi @malikmuzammal2,

The author is based on what is specified in your Git config settings, and you can change the settings by running these two commands:

git config --global user.name "your name"

git config --global user.email "your email"

To change the author on the latest commit you have to run this command:

git commit --amend --author="Author Name <email@address.com>" 

If the commit is not the latest commit, you should have to do a rebase to get back to the specific commit to change it. Have a look at this KB on how to do it.

Note that all these commands are run locally in your copy of the repsitory and then pushed back to Bitbucket. Also, make sure that the user is set up correctly in Bitbucket, it uses the email address to identify the author. So if you have two users with the same email Bitbucket will show the author as the first user it encounters in the user directory that has that email.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,756 views 10 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you