Change the author and committer name and e-mail of multiple commits in a bitbucket git repository

MisesEnForce October 5, 2016

Hello,

I am specialist into having a repo where I am working alone but where I end up commit with various accounts etc, which ends up being quite messy. Usually, to sort things out and rewriting history so that there's only one commit name, mail etc, I resort to this solution :

http://stackoverflow.com/questions/750172/change-the-author-and-committer-name-and-e-mail-of-multiple-commits-in-git

This time, I tried this for a Bitbucket repo, without success. Is there something special ?

1 answer

1 accepted

5 votes
Answer accepted
Johannes Kilian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 6, 2016

As you have already changed your commit author within your local repository: why not just use a forced push, to push your local changes to the remote server? (*git push --force*)

Caution:

  • Forcing pushes is not a good practice (http://willi.am/blog/2014/08/12/the-dark-side-of-the-force-push/)
  • Rewriting the author/committer creates NEW commits - mostly replacing the old commits. When you have had for example tags on your repository before your change of author, the tags are not moved to the new commits, as the tags are pointing to a certain SHA1 and this stays the old commit. You might have to transfer your tags etc. as well (probably manually) when rewriting author in your repository - unless you will loose your tags ...

 

MisesEnForce October 6, 2016

I don't why I didn't, as it made my day. Thx !

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events