Skip to content

Instantly share code, notes, and snippets.

@bdimcheff
Last active August 14, 2018 19:28
Show Gist options
  • Save bdimcheff/3796353 to your computer and use it in GitHub Desktop.
Save bdimcheff/3796353 to your computer and use it in GitHub Desktop.
git-recentbranch
#!/usr/bin/env bash
for k in `git branch -a|sed "s/..//"|sed "s/\s*->.*//"`;do echo -e `git log -1 --pretty=format:"%ct %Cblue%cr%Creset" "$k" --`\\t"$k";done|sort| cut -d' ' -f2-
@bdimcheff
Copy link
Author

  1. Stick this in a file called git-recentbranch and stick it in your path.
  2. Run "git recentbranch" from your favorite git repo.
  3. Now you don't need to ask which branch I just pushed. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment