Through various projects I’ve been working on in the last couple of years I’ve been digging deeper into Git. While many of Git’s basic operations are pretty straightforward, for someone getting used to Git it soon becomes apparent that some operations aren’t as simple as one might first expect, especially when using Git on the command line rather than with a GUI client.
I’ll expand on the topic later, but I wanted to create this stub article pointing to the GitHub repo I published a few days ago. It contains my annotated Git aliases (many of which I use as a quick reference as I haven’t yet committed all of them to memory), and a collection of helper scripts, many of which I have written myself, while few others, like git-wtf, I have not, but have included them for convenience. Also check out the README in the repo for alias dependencies and for other favorite Git extensions I frequently use.
Besides the enhanced Git command line, gitk with its visual blame tool (accessible from gitk, and also directly from the command line with
gui blame when gitk is installed), Atlassian SourceTree, Scooter Software’s BeyondCompare (for diffs and merges), and tig for repository viewing on the command line are now solidly part of my everyday Git toolkit.
Update 2016-12-26: If you like to use a graphical Git client, be sure to check out the awesome GitKraken (Windows/macOS/Linux, free + pro subscription). Tower is now also available for Windows, but with GitKraken having established itself, it’s now too little too late, especially for the Windows users who previously didn’t have a really good GUI Git client (Atlassian SourceTree is ok, but not really stellar).
It’s interesting how, every now and then, I come across some really obvious improvement to my workflow, even though that “fix” has been sitting â€“ literally â€“ under my nose all along. Here’s an example: today I was researching a better way to organize lengthy CSS files in an attempt to decide whether I should mix, in the list, classes and IDs, or separate them categorically as some classes are â€œlocalizedâ€ to a repeating structure on the page and work alongside a specific ID/IDs.Â To this end I was reading through comments for a stop design blog postÂ â€œCSS organization tip 1: Flagsâ€ and finally reached comment #49 written by â€œRidgeâ€ about three years ago: Â»Ah, the joy of a keyboard with a number pad. â€œ/â€ and â€œ*â€ are right next to one another. Quick two-finger â€˜da-dumâ€™ on the keys, and weâ€™re awayâ€¦Â»
Blink.Â Iâ€™ve always found cumbersome to hit shift-7 shift-â€˜ (I use Finnish/Swedish layout keyboard) to produce â€œ/*â€, and then few moments later the same in reverse to close the comment tag.Â And all along â€“ now at least for couple of years â€“ Iâ€™ve used a keyboard with a slash and asterisk sitting next to each other atop the number pad.Â Ah, so obvious!
As for the CSS organization, I think Iâ€™ve decided to create three groups: tag definitions (â€˜bodyâ€™, â€˜pâ€™, â€˜divâ€™, etc.), generic classes (used over and over again around the page/site), and IDs mixed with definitions for classes (e.g. â€œ.someLocallyUsedClass”) and tags (e.g. â€œ.someLocallyUsedClass aâ€) that only appear in association with the ID such as wrapper content. In the past Iâ€™ve divided classes and IDs categorically, only to have to jump around in the CSS file when editing a specific area of the page that utilizes, besides some IDs, one or more local tags or classes.
I posted on the DataMystic forums (manufacturer of TextPipe Pro) a brief tutorial on how to create powerful clip-board macros with help of TextPipe Pro and the free hotkey utility, AutoHotKey â€“ two utilities from my standard toolbox.
Clip-board macros with TextPipe and AutoHotKey