It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

stash user name and git config user name with stash API

anil kumar Apr 27, 2014

Hi All,

I created two users(user1,user2) with admin. I created repository and shared it to two users.

Now I cloned for user1 and user2 seperately(with seperate folders).

for user1:

in this repository I changed something and pushed to server. I got to know that it pushed with admin@example.com.

So, I ran the below commands in git

git config user.name "user1"

git config user.email "user1@example.com".

similarly I did for user2:

But how to get the user1 email with stash API.??

Thanks&Regards

Anil Kumar

3 answers

1 accepted

0 votes
Answer accepted
anil kumar Apr 27, 2014

I tried but not able to implement Person properly with Stash User.

So I found the solution which worked for me in this.

https://answers.atlassian.com/questions/13894/how-to-get-a-users-email-address

Thanks

Anil

0 votes
Balazs Szakmary Apr 27, 2014

Person (and StashUser, which inherits it) has a getEmailAddress method.

anil kumar Apr 28, 2014

But

with local machine If I did with this

1) $git config user.email "user1@example.com"

In this case how can I get the git configured email with stash API.

Thanks in advance

Anil

0 votes
Balazs Szakmary Apr 29, 2014

Changeset.getAuthor().getEmailAddress() gets you the mail address that was given by the user at the time of pushing.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

3,223 views 1 22
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you