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!
![Write Simple, Elegant and Maintainable Media Queries with Sass]()
I spent a few months experimenting with different approaches for writing simple, elegant and maintainable media queries with Sass. Each solution had something that I really liked, but I couldn't find one that covered everything I needed to do, so I ventured into creating my...
![39 Shirts – Leaving Mozilla]()
In 2001 I had just graduated from a small town high school and headed off to a small town college. I found myself in the quaint computer lab where the substandard computers featured two browsers: Internet Explorer and Mozilla. It was this lab where I fell...
![MooTools History Plugin]()
One of the reasons I love AJAX technology so much is because it allows us to avoid unnecessary page loads. Why download the header, footer, and other static data multiple times if that specific data never changes? It's a waste of time, processing, and bandwidth. Unfortunately...
![Create a Simple Slideshow Using MooTools, Part II: Controls and Events]()
Last week we created a very simple MooTools slideshow script. The script was very primitive: no events and no next/previous controls -- just cross-fading between images. This tutorial will take the previous slideshow script a step further by:
Adding "Next" and "Previous" controls.
Adding...
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