Find Git branch name in post-update hook [duplicate]
The first parameter to the post-update hook is the branch reference in full – for instance I see ‘refs/heads/master’ for a push to ‘origin master’. So an example hook script that just prints the branch modified is: #!/bin/sh branch=$(git rev-parse –symbolic –abbrev-ref $1) echo Update pushed to branch $branch exec git update-server-info To illustrate, when … Read more