Change the author and committer name and e-mail of multiple commits in a bitbucket git repository
Asked by Mede Made:

I have a repository which is already pushed to origin (online repo).  
I need to change author of 2 older commits.  

This happens because this buggy sourcetree (YES, IT IS, IT'S THE LATEST OF THE HUNDRED PROBLEMS IT GAVE ME, COMPANY FORCES ME TO USE IT) seems to have fun changing continuously the git project settings from the various authors available working on the same machine. I put the settings for commit to "John \<john@company.com\>" and from time to time, whenever sourcetree wants to have fun, it changes it to "John \<jim@Anothercompany.com\>" or "Jack \<jack@SomeOthercompany.com\>" because these profiles are present on the machine.  

I have saved multiple time the project settings, even tried to use global settings with my name but this bug-ridden productivity-hindering piece of software keeps acting his own way.  

How to change the old author from sourcetree (NOT git console)?  

Kinda like amend or whatever you want


Answers:
author: Mike Corsaro
body: Hello! Unfortunately this isn't something you can do via Sourcetree. We don't have many features to allow rewriting history, and it's generally not advised to do so.

However, to make your username issues a bit less annoying:

* Open Options, and **check** "Allow Sourcetree to modify your global Git and Mercurial config files"
* Open the repository, open the repo settings (top right gear), and make sure "Use global user settings" under advanced is **checked**
* Sourcetree will now modify your git settings (which can be found in 'C:\\Users\\\<username\>\\.gitconfig' under '**\[user\]**')

If you don't want Sourcetree to modify this config:

* Make sure "Allow Sourcetree to modify your global Git and Mercurial config files" is **unchecked**
* Open your .gitconfig (C:\\Users\\\<username\>\\.gitconfig), and under '**\[user\]**' change your desired username
* Restart Sourcetree
* Your username for will now be whatever is set in your .gitconfig

Be aware that other programs on your PC may modify your .gitconfig and overwrite it with a different username. Visual Studio has known to do this.

comments: author: Francisco Camargo
body: I'm on 3.2.6 on Win10. Currently, I have trouble with my global settings, I was hoping the second method would help but it has not.

What has been happening is that I end up commuting with undesired Author information: both the name and the email are wrong. I *suspect* that Sourcetree is grabbing information from tools \> options \> authentication and using it as my Author info.

I have the name and email settings I want to be used in the gitconfig file. But the only way I have been able to commit using that information is to go into each of my repos: settings \> advanced \> user information \> uncheck the box "Use global user settings"

The Author text that shows up under the check box is always what I want to use, but only when I uncheck the box am I able to commit with said text.

Again, I tried your second method hoping it would help, but no luck.


author: Logan
body: I have a similar situation on my new Windows 10 laptop and haven't been able to figure it out. When I commit and push using Sourcetree 3.4.5 or 3.4.6, it clearly shows my correct user name and user email, but after the commit, I get the message below.

My .gitconfig is properly configured and the Settings \> Advanced is set up to "Use global user settings". Everywhere I've looked, (Credentials Manager, .gitconfig, Repository Settings, CMD git config --global, etc. shows the correct user name and user email. I can't find where it shows LOGAN anywhere.

To further test, I've backed up my repo, cloned a fresh copy, made all my coding updates, made sure user.name and user.email were still correct, committed the change, and still got the error below:

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks push -v --tags --set-upstream origin feature/AEM-1700:feature/AEM-1700  
POST git-receive-pack (3377 bytes)  
remote: GUAVA Validation Error  
remote: GUAVA Commit Checker  
remote: PUSH FAILED  
remote: Commit ID: 912efe7baacc396e256b3d97e3832c4682929cfa  
remote: The User Name: LOGAN does not contain a valid UID. User Names must be of the format 'lastName, firstName (uid)' or 'uid' and the UID must be a valid ID.  
remote: The email address for this user email must be in the format of: 'uid@\*.company.com and the UID in the email must match the UID of the user name.  
remote: Please correct user information for User Name: "LOGAN" Email: \<blogan@company.com\>  
remote: Powered by GUAVA-19.11.01-SNAPSHOT


author: Manju
body: Can you please specify if this is on Windows or macOS and what version of Sourcetree you are using?

comments: author: Mede Made
body: Windows 10, last sourcetree version