ThreadSky
About ThreadSky
Log In
tylerhillery.com
β’
91 days ago
Nice one liner I like to use to clean up my branches
Comments
Log in
with your Bluesky account to leave a comment
[β]
mrlarrieu.bsky.social
β’
91 days ago
Danger zone! Use with caution! And donβt forget that -v π
1
reply
[β]
stately.cloud
β’
90 days ago
I use a slightly different version saved as `~/bin/git-delete-merged-branches` so I can run it with "git delete-merged-branches":
#!/bin/sh
git branch --merged | grep -v "\*" | grep -v "^\s*\(master\|main\)$" | xargs -n 1 git branch -d
The `git branch --merged` is the most important bit.
1
1
reply
[β]
tylerhillery.com
β’
90 days ago
TIL about --merged flag, thanks! -d always caught that for me ( vs -D )
0
reply
[β]
tannerr.bsky.social
β’
91 days ago
π
0
1
reply
[β]
tannerr.bsky.social
β’
91 days ago
had to google what the -v did, nice π, thought it was a joke for a sec
1
reply
[β]
schrepfler.bsky.social
β’
91 days ago
After you've merged the other branches, right? Right?
4
reply
Posting Rules
Be respectful to others
No spam or self-promotion
Stay on topic
Follow Bluesky's terms of service
×
Reply
Post Reply
Comments
#!/bin/sh
git branch --merged | grep -v "\*" | grep -v "^\s*\(master\|main\)$" | xargs -n 1 git branch -d
The `git branch --merged` is the most important bit.