git sha shortcut
When I'm working in a git repository, I often want to get the current sha. You can use the rev-parse
command for this:
$ git rev-parse HEAD
7fd1a60b01f91b314f59955a4e4d4e80d8edf11d
I like to define a "sha" alias in my ~/.gitconfig:
[alias]
sha = rev-parse HEAD
Then I can just do:
$ git sha
7fd1a60b01f91b314f59955a4e4d4e80d8edf11d
Written by Lorin Hochstein
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#