Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Username in pre-commit hook using SSH URI?

David Schmidt 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