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

Incredible Demos

  • By
    Image Manipulation with PHP and the GD Library

    Yeah, I'm a Photoshop wizard. I rock the selection tool. I crop like a farmer. I dominate the bucket tool. Hell, I even went as far as wielding the wizard wand selection tool once. ...OK I'm rubbish when it comes to Photoshop.

  • By
    Chris Coyier&#8217;s Favorite CodePen Demos II

    Hey everyone! Before we get started, I just want to say it's damn hard to pick this few favorites on CodePen. Not because, as a co-founder of CodePen, I feel like a dad picking which kid he likes best (RUDE). But because there is just so...

Discussion

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