1

We are using GIT as a source code repository for our Delphi projects.

Can I get Git Branch ID , Git Revision number, .... each time I compile my apps?

I would like to show these data in some help box

Antonio Petricca
  • 8,891
  • 5
  • 36
  • 74
Franz
  • 1,883
  • 26
  • 47
  • [This](https://stackoverflow.com/questions/2087402/delphi-pre-build-event-not-executing-before-compile) can be useful. – Olivier Sep 03 '21 at 08:58
  • Note that those who *wrote* Git set up their builds to capture version information by running `git describe`. Doesn't mean that's the right answer, but, well, Linus and Junio do kind of know what they're doing with Git. :-) – torek Sep 03 '21 at 16:22

1 Answers1

0

Here the answers:

  • Git branch id by git branch --show-current
  • Git revision number by git rev-parse HEAD (NB: the revision number is the last commit hash)
Antonio Petricca
  • 8,891
  • 5
  • 36
  • 74