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 Gradients

    With CSS border-radius, I showed you how CSS can bridge the gap between design and development by adding rounded corners to elements.  CSS gradients are another step in that direction.  Now that CSS gradients are supported in Internet Explorer 8+, Firefox, Safari, and Chrome...

  • By
    From Webcam to Animated GIF: the Secret Behind chat.meatspac.es!

    My team mate Edna Piranha is not only an awesome hacker; she's also a fantastic philosopher! Communication and online interactions is a subject that has kept her mind busy for a long time, and it has also resulted in a bunch of interesting experimental projects...

Incredible Demos

Discussion

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