Size: 335
Comment:
|
← Revision 3 as of 2021-07-28 22:42:14 ⇥
Size: 387
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 3: | Line 3: |
* From: https://stackoverflow.com/questions/7726949/remove-tracking-branches-no-longer-on-remote {{{ |
* From: https://stackoverflow.com/questions/7726949/remove-tracking-branches-no-longer-on-remote {{{ |
Line 6: | Line 5: |
git branch --merged >/tmp/merged-branches && \ | git checkout master && git branch --merged | grep -vi "master\|main\dev" >/tmp/merged-branches && \ |
Line 8: | Line 8: |
}} | }}} |
Git/Cleanup
- Notes on cleaning a git repo, with a lot of old branches.
From: https://stackoverflow.com/questions/7726949/remove-tracking-branches-no-longer-on-remote
git remote prune origin git checkout master && git branch --merged | grep -vi "master\|main\dev" >/tmp/merged-branches && \ vi /tmp/merged-branches && xargs git branch -d </tmp/merged-branches