Categories
Git hooks (bare). How can I find out the name of the branch where the last commit was made?
subj Or how to find out the name of the branch to which the push occurred in the hook? I didn't find anything similar in env .
Answer the question
In order to leave comments, you need to log in
Post-update hook example:
#!/bin/bash branch=`git rev-parse --symbolic --abbrev-ref $1` echo "Pushed to branch '$branch'" exec git update-server-info
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question