Quick git Commit Searching

By  on  

While I love GitHub for the way it presents git repository information to me, I've been trying hard not to rely so much on GUI web apps and desktop apps, instead looking to use command line equivalents.  You see that in my recent shell posts, including Tweet from Command Line with tHow to Watermark Images and VideosAccess Mac Camera by Command Line, and more.  The command line is magic™!

One frequent git task is searching a list of commits on master branch which match a given keyword.  Here's how I do that:

git log -i --grep='ckeditor'

In the command above, I'm searching the commit log for commits and/or authors that relate to CKEditor, a component of MDN that I frequently update.  A sample result would look like:

commit 1d5dfd86633488873326774819c0e7b362fadfb0
Merge: 84a271c 4f0a7e3
Author: John Karahalis <redacted@gmail.com>
Date:   Thu Aug 20 15:59:37 2015 -0400

    Merge pull request #3425 from darkwing/1196252-ckeditor

    fix bug 1196252 - Upgrade CKEditor to 4.5.3

commit 4f0a7e3602058079bdc9ab7fad3cfd0513596045
Author: David Walsh <redacted@gmail.com>
Date:   Wed Aug 19 09:49:34 2015 -0500

    fix bug 1196252 - Upgrade CKEditor to 4.5.3

commit 4e55f36f58a1f792bd8869c2c97cecb2951e5afa
Merge: 57a7c2a cda134e
Author: luke crouch <redacted@gmail.com>
Date:   Thu Jul 2 13:15:33 2015 -0500

    Merge pull request #3302 from darkwing/975868-ckeditor-upgrade-2

    Bug 975868 - Upgrade CKEditor to 4.4.8

:

I love being able to see this result quickly within the command line instead of having to open my browser, navigate to GitHub, use their search, etc.  We all know git is super powerful -- we should aim to use each feature!

Recent Features

  • By
    CSS vs. JS Animation: Which is Faster?

    How is it possible that JavaScript-based animation has secretly always been as fast — or faster — than CSS transitions? And, how is it possible that Adobe and Google consistently release media-rich mobile sites that rival the performance of native apps? This article serves as a point-by-point...

  • By
    Responsive Images: The Ultimate Guide

    Chances are that any Web designers using our Ghostlab browser testing app, which allows seamless testing across all devices simultaneously, will have worked with responsive design in some shape or form. And as today's websites and devices become ever more varied, a plethora of responsive images...

Incredible Demos

  • By
    Six Degrees of Kevin Bacon Using MooTools 1.2

    As you can probably tell, I try to mix some fun in with my MooTools madness but I also try to make my examples as practical as possible. Well...this may not be one of those times. I love movies and useless movie trivia so naturally I'm...

  • By
    WebKit-Specific Style:  -webkit-appearance

    I was recently scoping out the horrid source code of the Google homepage when I noticed the "Google Search" and "I'm Feeling Lucky" buttons had a style definition I hadn't seen before:  -webkit-appearance.  The value assigned to the style was "push-button."  They are buttons so that...

Discussion

    Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!