Skip to content

Instantly share code, notes, and snippets.

@phdesign
Created March 24, 2024 20:47
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 phdesign/cf475812d5a33ebb00b3d894354d1df3 to your computer and use it in GitHub Desktop.
Save phdesign/cf475812d5a33ebb00b3d894354d1df3 to your computer and use it in GitHub Desktop.
Handy git alias commands
[alias]
prune-gone = !git remote prune origin && git branch -v | grep gone | awk '{print $1}' | xargs git branch -D
recent = !git for-each-ref --sort='-authordate:iso8601' --format='%(authordate:relative)%09%(refname:short)' refs/heads | head -15
@phdesign
Copy link
Author

Also,

git checkout -

to switch back to last branch.

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