Skip to content

Instantly share code, notes, and snippets.

@npatmaja
Created March 22, 2018 02:36
Show Gist options
  • Save npatmaja/be6af05510a7b09f108df192deb6db01 to your computer and use it in GitHub Desktop.
Save npatmaja/be6af05510a7b09f108df192deb6db01 to your computer and use it in GitHub Desktop.
Git alias to sort remote branches based on last updated time desc
blremotesorted = "!for branch in `git branch -r | grep -v HEAD`;do echo `git show --format=\"%ci %cr %an\" $branch | head -n 1` \t$branch; done | sort -r"
blremotesortedcsv = "!for branch in `git branch -r | grep -v HEAD`;do echo `git show --format=\"%ci,%cr,%an\" $branch | head -n 1`,$branch; done | sort -r"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment