1

I am admin for my bitbucket project .

We have some checkins done on the brach .

Say checkin_1, checkin_2,checkin_3,checkin_4,checkin_5

I want to edit commit messages in checkin_2,checkin_3,checkin_4 , including user who checked in . Basically some personal email address was wrongly put by a person and commit message is garbled .

I want to have correct commit messages for future reference & correct the email address used there as well .

How can i do so . Given that i am an admin , i think its possible :)

MAG
  • 2,841
  • 6
  • 27
  • 47

1 Answers1

1

You need to clone your BitBucket repo, fix it locally, and force a push (since you will have changed the history).
That can be an issue if others have already cloned the repo: you need to communicate they need to reset their own local copy: see "git pull after forced update".

You can do an interactive rebase, and, as described in "Change commit author at one specific commit"

change the text from pick to edit next to the hash of the one you want to modify. Then when git prompts you to change the commit, use this:

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

In your case, if change1 if the oldest commit, and change5 the most recent:

git rebase -i change1~
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250