Skip to content

Instantly share code, notes, and snippets.

@vinaysshenoy
Last active March 27, 2024 03:32
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 vinaysshenoy/af0f7af58b8047774706f483f0975288 to your computer and use it in GitHub Desktop.
Save vinaysshenoy/af0f7af58b8047774706f483f0975288 to your computer and use it in GitHub Desktop.
Useful git commands
  1. Delete all local git branches except current
git branch --list | grep -v "^* $(git branch --show-current)$" | xargs git branch -D 
  1. Clean up GIT repository
git reflog expire --expire=now
git prune
git lfs prune
git gc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment