Get Git Branches Checked Out on a Date

By  on  

I don't use any type of git UI -- I try to be hardcore and stick to the command line.  This makes git usage quicker but I also probably miss out on a lot of the functionality that would be nice to know.  The functionality is there, of course, but without a nice icon or menu item you don't really think about it.

I was browsing CommandLineFu and found a nice git snippet which provides you a listing of branches checked out on a given date:

git reflog --date=local | grep "Sep 10 .* checkout: moving from .* to" | grep -o "[a-zA-Z0-9\-]*$" | sort | uniq

I love this snippet because I often forget recently created branch names (...grow up and delete old branches, David!), especially when leaving work for the weekend.  Handy!

Recent Features

  • By
    How to Create a RetroPie on Raspberry Pi – Graphical Guide

    Today we get to play amazing games on our super powered game consoles, PCs, VR headsets, and even mobile devices.  While I enjoy playing new games these days, I do long for the retro gaming systems I had when I was a kid: the original Nintendo...

  • 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...

Incredible Demos

  • By
    Duplicate the jQuery Homepage Tooltips Using Dojo

    The jQuery homepage has a pretty suave tooltip-like effect as seen below: Here's how to accomplish this same effect using Dojo. The XHTML The above HTML was taken directly from the jQuery homepage -- no changes. The CSS The above CSS has been slightly modified to match the CSS rules already...

  • By
    jQuery UI DatePicker:  Disable Specified Days

    One project I'm currently working on requires jQuery. The project also features a datepicker for requesting a visit to their location. jQuery UI's DatePicker plugin was the natural choice and it does a really nice job. One challenge I encountered was the...

Discussion

  1. That was really helpful. I created a script “branches by date” to make it easier to use, I hope that someone will find it useful. https://gist.github.com/ahmedelgabri/2684c4578c3fe5990c5a

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