This article describes how to delete merged branches in local and origin.
👽 Delete all merged branches in remote
git branch -r --merged master | grep -v -e master -e develop | sed -e 's% *origin/%%' | xargs -I% git push --delete origin % |
- Show all merged branches in master on origin
- I exclude master and develop because we do not want them to disappear
- Delete origin/***
- xargs (pass all branch names with -I%% and delete all)
🏀 Delete all merged branches in local
git branch --merged master | grep -vE '^\*|master$|develop$' | xargs -I % git branch -d % |
- Show all merged branches to master on local git
- I exclude master and develop because we do not want them to disappear
- xargs (pass all branch names with -I%% and delete all)
😸 References
🖥 Recommended VPS Service
VULTR provides high performance cloud compute environment for you.
Vultr has 15 data-centers strategically placed around the globe, you can use a VPS with 512 MB memory for just $ 2.5 / month ($ 0.004 / hour).
In addition, Vultr is up to 4 times faster than the competition, so please check it => Check Benchmark Results!!