The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to edit commits that have been pushed to Stash

Jordan Packer
Contributor
December 17, 2014

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
TimP
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 Champions.
December 17, 2014

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.

cheers,

Tim

Jordan Packer
Contributor
December 17, 2014

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
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 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. https://www.kernel.org/pub/software/scm/git/docs/git-shortlog.html#_mapping_authors

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

Cheers,

Adam

 

TAGS
AUG Leaders

Atlassian Community Events