How to edit commits that have been pushed to Stash

One of our users has committed using the wrong email address, which is causing a number of different problems. We can't have two identities out there for this developer. I understand that there are ways to "rewrite history" in git, but how does that change when Stash is involved?

2 answers

1 accepted

1 vote
Answer accepted

Hi Jordan,

Stash is "just another Git remote" so you can rewrite history locally and force push it to Stash as normal. All of the normal issues with rewriting history will apply though - rewriting history that's already been shared is usually not a great idea - but it is possible if you synchronize everything carefully with your team.



Thanks Tim, we have a fairly small amount of people that have cloned this repo, so it shouldn't be too difficult to coordinate with them and just have them delete and then clone fresh.

2 votes
Adam Ahmed Atlassian Team Dec 17, 2014

Hi Jordan,

Another fix for this specific problem is to use Git's .mailmap feature, no rewrite necessary. This lets you use a secondary email as an alias for the one your dev really meant to use.

This is basically a file you add to your repo, and Stash will use to display correct author information.




Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 14, 2019 in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

309 views 0 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you