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?
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 <firstname.lastname@example.org>"
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.
Hi everyone, We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...
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