Skip to content

Instantly share code, notes, and snippets.

@tomchapin
Last active April 11, 2020 03:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomchapin/a037eb08644ae2f4a408b501b3e1643f to your computer and use it in GitHub Desktop.
Save tomchapin/a037eb08644ae2f4a408b501b3e1643f to your computer and use it in GitHub Desktop.
#!/bin/bash
# --------------------------------------------------------------------------
# Git Recent (by Tom Chapin - https://www.github.com/tomchapin)
# --------------------------------------------------------------------------
# This command lists your local branches which have recent commits in them.
# --------------------------------------------------------------------------
# Installation:
# Copy this script as a file named "git-recent" somewhere in
# your path (For example: /usr/local/bin/git-recent), and then
# run "chmod +x git-m2p" to give it execution permissions.
# --------------------------------------------------------------------------
# Usage:
# From inside your git repo, type "git recent"
# --------------------------------------------------------------------------
set -euo pipefail
# git for-each-ref --sort=-committerdate refs/heads/ --format='%(committerdate:short) - %(refname:short)' | head -n 20
git --no-pager branch --sort=-committerdate -v | head -n 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment