Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change committed User name in bitbucket?

How to change commit username in bitbucket account ? To change in git I have used this command

 git filter-branch -f --env-filter " GIT_AUTHOR_NAME='newUser' GIT_AUTHOR_EMAIL='[email protected]' " HEAD

It only change username in local machine but not in my bitbucket account. How to change committed username in bitbucket ?

like image 785
Amrit Dhungana Avatar asked Dec 05 '22 06:12

Amrit Dhungana


1 Answers

Like Chris said, it is a bad practice to rewrite your git history.

The recommended way to map authors is to use the .mailmap feature.

Create a .mailmap file at the top level of your repository with the following content:

New Name <[email protected]> Old Name <[email protected]>

This will replace Old Name <[email protected]> in git history with New Name <[email protected]> and these changes will also reflect on Github and Bitbucket.

like image 169
Alexandru Guzinschi Avatar answered Dec 08 '22 16:12

Alexandru Guzinschi