-1

If I would like to know which commit current master branch is referring to, how could I do that?

Is there a way to check the SHA1 of master in GIT?

athos
  • 6,120
  • 5
  • 51
  • 95
  • sure, `git rev-parse some-branch` should give you the commit id that the branch is pointing to (to the best of your current knowledge.... if it's a remote branch it might have moved and you won't know about it until you fetch). – eftshift0 Dec 13 '22 at 08:33

1 Answers1

2

Yes, you can use the rev-parse command for that:

git rev-parse master

This will return the SHA-1 of the commit being referenced by the master branch.

Enrico Campidoglio
  • 56,676
  • 12
  • 126
  • 154