git tips: get commit hash

Hashes are used in GIT to uniquely identify commits in history. Sometimes its useful to get a hash of specific commit.

To get hash of current commit use command:

git rev-parse HEAD

You can create alias for the command and save it in .bashrc:

echo 'alias commit_hash="git rev-parse HEAD"' >> ~/.bashrc

--

--