Get the current git commit from a file


If you need to get the current commit, but don’t want to run git rev-parse HEAD, you can get it from .git/refs/heads/master where master is the branch you are interested in.

Date: 2018-03-04

Tags:  git

Share: