Skip to content

Instantly share code, notes, and snippets.

@bwlt
Last active February 2, 2023 15:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bwlt/7f3adf423da4e3f20db18c9daf109f4b to your computer and use it in GitHub Desktop.
Save bwlt/7f3adf423da4e3f20db18c9daf109f4b to your computer and use it in GitHub Desktop.
shell alias, useful for cleanup local branches when the remote branch has been deleted (for example merged branch)
# useful for cleanup local branches when the remote branch has been deleted (for example merged branch)
gdgone='git branch -v | grep " \[gone\] " | awk '\''{ print $1 }'\'' | xargs git branch -D'
# updates the local repository branches to the latest and performs cleanup.
# gf, gco and gl are alias for git fetch, git checkout and git pull
gstart='gf -p && gco master && gdgone && gl && gco develop && gl'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment