Force users to use their Active Directory username


I'm currently evaluating Stash for our company because we want to try git and I heard a lot of good things about Stash. We are currently using SVN for a couple web projects but we are not 100 percent lucky with it because there are some things which would definitely work better with git.

After a few hours working with git and Stash it looks like it would work pretty well for us. There's one thing I don't understand though. This might not be a problem specific with Stash but with git in general. I configured Stash to sync with our Active Directory and as soon as I want to push or pull from a repository I have to enter my AD credentials. That works great. After pulling a repository from Stash I can make each commit with a different username and email address. After pushing this repository back to Stash, all these usernames are shown up in the log. Now I'm wondering if there's any change to force all users using their own Active Directory username?

Thanks for your help!

1 answer

1 accepted

0 votes
Answer accepted

Hi Yves,

You've discovered one of the tradeoffs with Git and DVCS in general.

Depending on how you are using Git this restricting pushes may not work quite how you expect. If you're making single commits and pushing to Stash then everything will be fine. However, if hyptothetically someone pulls from another author (from a fork say), and then decides to push they will be denied. The only option at that point is to get the other person to push first or rewrite history (neither of which is ideal). It's complicated...

All that said, you might be interested in the following plugin. :)

The other option would be to require users have a pre-commit hook localy, but that comes with it's own set of problems (ie you can bypass it fairly easily).

I hope that answers your question?


Hi Charles,

Thanks for your answer. That's what I expected and it makes totally sense to me. I'll check out the plugin.


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Thursday 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...

228 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