Username in pre-commit hook using SSH URI?

David Schmidt
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 5, 2012

Since SSH URI's in Stash have the username set to "git", is the username of the current user available to server side git hooks like pre-commit? We'd like to be able to restrict commits to specific repositories or branches to select users.

1 answer

1 accepted

0 votes
Answer accepted
jhinch (Atlassian)
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 5, 2012

The current user is available to all of git's hooks whether it be via SSH or HTTP/HTTPS through the REMOTE_USER environment variable. In HTTP we resolve the user via their basic authentication credentials. In SSH we resolve the user via their SSH key.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events