Get the Git Commit ID via Command Line
I know just enough git to be dangerous. I'm not doing advanced bisecting but I can stash, rebase, and reset with the best of them. One new trick I learned from my boss, Luke Crouch, saves me loads of time: getting the commit ID via command line. For years I would merge a PR, go the project's main page, and copy the commit ID so that I could push code to staging and production. Always seemed like an extra step rather than just making it happen from the terminal. Here's the magical command:
git rev-parse HEAD
Of course you need to update your local repo to remote master, but you do that anyway, right? Hopefully this will become a timesaver the same way it has for me!
My first professional web development was at a small print shop where I sat in a windowless cubical all day. I suffered that boxed in environment for almost five years before I was able to find a remote job where I worked from home. The first...
One of the web components I've always loved has been Facebook's modal dialog. This "lightbox" isn't like others: no dark overlay, no obnoxious animating to size, and it doesn't try to do "too much." With Facebook's dialog in mind, I've created LightFace: a Facebook lightbox...
The lightbox is probably one of my favorite parts of the Web 2.0 revolution. No more having to open new windows (which can bog down your computer quite a bit) to see a larger image, video, etc. Instead, the item loads right into the...
On Mac, you should try this, it will copy the commit ID to your clipboard:
Also you can use short version of git hash:
I miss working a Mac, but Windows is working out just great too.
To shorten things further, you can use @ as an abbreviation of HEAD.
Here’s npm package if you need it in JS: https://github.com/sheerun/git-commit-id