0

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 Answers1

0

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.

James Moger
  • 1,721
  • 12
  • 12
  • Hi James, if my last update was into only one branch, if I am correct I can get the ref of the last cammand received and that will points to the expected branch. Is this correct? – Marcos Costa Pinto Jun 20 '15 at 14:04