SSH key access uses local email address instead of User Directory email address

It would appear that Stash does not use the email address associated with the Stash user account when SSH keys are used to access repositories.  We were performing an audit and were surprised to see logs stating that commits had been made by a user with a gmail account.  We are using Active Directory as a User Directory and there are no gmail accounts in our farm.  We did some digging and found that the employee with the gmail account was using SSH to access the repository.  

Is there a way to force Stash to use the email address from the user directory and not the email address that a user has set on their local system?

1 answer

1 vote
Adam Ahmed Atlassian Team Feb 09, 2015

I assume you mean the dev had his author email set to something@gmail.com. This isn't something Stash has control over, especially since changing that email affects the commit hash. We'd have to rewrite history to make the change, and that's not something you want your Git hosting server to do. smile

Your options are to either add a pre-commit hook that rejects commits that don't match your requirements (e.g. disallow @gmail author emails) which can prevent this problem in the future, or you can use the built-in Git .mailmap feature to "map" commits from his @gmail.com address to whatever email you'd prefer to see. This will "fix" any past mistakes. Stash will also respect the contents of your .mailmap file in our UI. You can read more about the .mailmap file here (under "Mapping authors").

Cheers,
Adam

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

27,082 views 26 12
Join discussion

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