Skip to content

Instantly share code, notes, and snippets.

@ratbeard
Last active August 29, 2015 14:08
Show Gist options
  • Save ratbeard/e9a8cad00f0f27add4f1 to your computer and use it in GitHub Desktop.
Save ratbeard/e9a8cad00f0f27add4f1 to your computer and use it in GitHub Desktop.
# Fetch latest and prints the branch name with the most recent commit¬
br = "!git fetch && git for-each-ref --count=1 --sort=-committerdate refs/remotes/ --format='%(refname:short)' | sed -e \"s/^.*\\//
¬
# Switch to branch with most recent commit¬
cor = "!git checkout `git br`"¬
¬
@lancebecker
Copy link

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