Skip to content

Instantly share code, notes, and snippets.

@alana314
Created August 9, 2021 23:55
Show Gist options
  • Save alana314/d60d804b2c4ccb43f207b8887a6ac8a0 to your computer and use it in GitHub Desktop.
Save alana314/d60d804b2c4ccb43f207b8887a6ac8a0 to your computer and use it in GitHub Desktop.
git show recent branches
#!/bin/bash
#show recent branches. You could make this file as /usr/local/bin/gitshowbranches, chmod it to execute it, and then run "gitshowbranches" to show recent branches
#based on https://stackoverflow.com/questions/5188320/how-can-i-get-a-list-of-git-branches-ordered-by-most-recent-commit
git branch --sort=-committerdate | head
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment