Skip to content

Instantly share code, notes, and snippets.

@RomarQ
Created September 13, 2022 07:12
Show Gist options
  • Save RomarQ/10ff48b04a9a731c684e58485f712b67 to your computer and use it in GitHub Desktop.
Save RomarQ/10ff48b04a9a731c684e58485f712b67 to your computer and use it in GitHub Desktop.
Git Cheat Sheet

Delete all remote branches but main.

git branch -r | grep -v "main" | cut -d/ -f2- | while read line; do git push origin :heads/$line; done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment