Python-Git recent v1.0.3: See your latest local git branches, formatted real fancy

Latest Release: v1.0.3


Type git recent to see your latest local git branches


git recent

Optionally, add -n<int> to see the most recent <n> branches

git recent -n5

git-recent screenshot

If you're a Windows user, you need to use Git Bash or similar shell in order to effectively use this utility.


You can add the git-recent location to your path (e.g. add the directory to your PATH environment or copy git-recent into an existing included path like /usr/local/bin or ~/bin/).

You can use also npm to install the global binary:

npm install --global git-recent

On Mac, you can install with homebrew:

brew install git-recent

If you like this you may also be interested in...

  • git open - Open the repo website in your browser
  • diff-so-fancy - Making the output of git diff so fancy


Copyright Paul Irish. Licensed under MIT.


  • 2016-05-16 - added to paulirish/dotfiles
  • 2016-08-05 - released in standalone repo and published to npm


  • error: unknown option `color=always'
    error: unknown option `color=always'

    Mar 3, 2018

    This affects OS X 10.11 and below.

    ==> brew test git-recent --verbose
    ==> FAILED
    Testing git-recent
    /usr/bin/sandbox-exec -f /tmp/ /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/bin/ruby -W0 -I /usr/local/Homebrew/Library/Homebrew -- /usr/local/Homebrew/Library/Homebrew/test.rb /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/git-recent.rb --verbose
    ==> git init
    Initialized empty Git repository in /private/tmp/git-recent-test-20180303-48977-s6zris/.git/
    ==> git recent
    error: unknown option `color=always'
    usage: git for-each-ref [<options>] [<pattern>]
       or: git for-each-ref [--points-at <object>]
       or: git for-each-ref [(--merged | --no-merged) [<object>]]
       or: git for-each-ref [--contains [<object>]]
        -s, --shell           quote placeholders suitably for shells
        -p, --perl            quote placeholders suitably for perl
        --python              quote placeholders suitably for python
        --tcl                 quote placeholders suitably for Tcl
        --count <n>           show only <n> matched refs
        --format <format>     format to use for the output
        --sort <key>          field name to sort on
        --points-at <object>  print only refs which points at the given object
        --merged <commit>     print only refs that are merged
        --no-merged <commit>  print only refs that are not merged
        --contains <commit>   print only refs which contain the commit
  • Add as zsh plugin like git-open ?
    Add as zsh plugin like git-open ?

    Dec 17, 2018

  • customizable colors would be neat
    customizable colors would be neat

    Jun 21, 2019

    In Powershell's default color scheme the blue author name on blue background is not easy to read.


    It would be helpful if there were an easy way to change the color.

  • Why `%(upstream:track)`?  ... I'm intrigued!  😀
    Why `%(upstream:track)`? ... I'm intrigued! 😀

    Jun 24, 2019

    It's not wrong, but I was just wondering about the purpose of this line:

    %(color:bold yellow)%(upstream:track)%(color:reset)

    The %(upstream:track) directive is only relevant if you have two local branches, one of which is the upstream for the other one... put differently: it has no relevance for remote-tracking branches.

    Like I said: nothing wrong with it, but I'm intrigued by the workflow where you have a local branch with an upstream local... ie. what kind of git workflow would give rise to this use-case?

  • Accept count as '-X' as well, add usage and error handling
    Accept count as '-X' as well, add usage and error handling

    Mar 20, 2020

    Also make shellcheck happy.

  • Add zsh plugin
    Add zsh plugin

    Jul 7, 2020

    closes #18

  • Tag releases
    Tag releases

    Jan 16, 2017

    Nice tool! Only just found it. 😮

    I've submitted a PR at homebrew/homebrew-core#8979 to get it brew installable - this issue is in anticipation of being told the release needs to be git tagged (or otherwise have the version number in it).

    Might that be possible? 🙂

  • Table format broken on Windows
    Table format broken on Windows

    Aug 11, 2016

    At the expense of being the odd one out around here on Windows, I installed git-recent on my system and already love it. It works perfectly overall, except for one minor thing. column messes up the table layout when there are control chars in any except the last column. For example:


    If I go and temporarily remove the coloring from the refname like so:

    - %(HEAD) %(color:yellow)%(refname:short)%(color:reset)|\
    + %(HEAD) %(refname:short)|\
      %(color:bold red)%(objectname:short) %(color:bold green)(%(committerdate:relative)) %(color:blue)%(authorname) %(color:reset)%(color:yellow)%(upstream:track)%0a\
    -   %(color:black) %(color:reset)|%(contents:subject)%0a\
    +    |%(contents:subject)%0a\

    Then columns do line up properly and match the screenshot on the README:


    If I have to guess, this seems to be more of a column problem than a git recent problem, but I though I bring it up in case I'm missing something. If anyone can point me in the right direction I can make a PR attempt.

  • Fix typo
    Fix typo

    Aug 5, 2016

    Fixes a small typo

  • Handle new git behavior requiring count parameter
    Handle new git behavior requiring count parameter

    Jun 14, 2019


    I ran into an issue today with git-recent where it was giving me an error:

    error: option `count' expects a numerical value

    I believe my build environment upgraded git with a new constraint on the --count parameter, as shown in this commit:

    Passing a count of 0 appears to behave the same way it used to when the count was missing. It does still render some strange (null) values (with or without the -n parameter), but I suspect that's yet another fix that may need to happen in addition to this one.

  • Option to show commit descriptions
    Option to show commit descriptions

    Sep 2, 2016

    For when someone commits with a "WIP" message, just to add an essay description.

  • Workaround for broken format on Windows
    Workaround for broken format on Windows

    Aug 27, 2016





    Essentially, this trades yellow refnames with proper alignment. Once column is fixed, this can then be burned to ashes. This only affects Windows.

    Ref. #8

  • show ↑↓ information
    show ↑↓ information

    Aug 6, 2016


  • Add count parameter
    Add count parameter

    Nov 19, 2016

    Added a count parameter so users could see the last n ~~commits~~ branches.

    Completely optional argument, see below:


    git recent default behavior git recent 0 default behavior git recent 5 last 5 ~~commits~~ branches returned, instead of all of them git recent ( n > number of total branches ) default behavior

    ...and so on.

  • git-recent's output does not highlight
    git-recent's output does not highlight

    Nov 3, 2017

    I don't know why, my iterm2 can't highlight the git-recent's output.

  • Windows compatibility
    Windows compatibility

    Aug 8, 2016

    Hi @paulirish

    I have installed the module on my machine running Windows 10 and got the following: git-recent I think something is missing while running it on the Windows.