how to get latest commit ref on giblit post commit hook

288 views Asked by At

I am trying to get branch name of the last commit pushed to git that triggered my post-commit groovy script, anybody has an idea that how can I do this??

1

There are 1 answers

1
James Moger On

There are many examples of how to get that info. Try this one: https://github.com/gitblit/gitblit/blob/master/src/main/distrib/data/groovy/blockpush.groovy

The important thing to remember is that git can push multiple refs (branches & tags) simultaneously so it's easy to receive more than one.