Created
June 16, 2026 12:43
-
-
Save ulgens/3e739471c5c6b802a85515ea72bf98da to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Delete merged branches | |
| git fetch -p && for branch in $(git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == "[gone]" {sub("refs/heads/", "", $1); print $1}'); do git branch -D $branch; done | |
| # Update origin from upstream | |
| git fetch upstream && git checkout main && git merge upstream/main | |
| # ^Same thing but for dinosaurs | |
| git fetch upstream && git checkout master && git merge upstream/master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment