4 ms·
I have lot of old local Git branches. Most were pushed on the central server. The central server also have some old branches. Some local branches have been reba
by dolmen 2y ago
I have lot of old local Git branches. Most were pushed on the central server. The central server also have some old branches. Some local branches have been rebased locally. Some have been rebased on the server. Some have been merged on the server (with rebase or not).
I need to clean-up both my local clone and the central server from the branches which contain changes that have been fully merged
Can Jujutsu help with that task?
If not, any other solution?
- stouset 2y agoYes, almost certainly. Jujutsu has an embedded mini-language to specify revsets. It’s not too hard to make a revset for “all branch names that are descendants of trunk (main/master)”. You can feed this directly into `jj branch delete`, which will remove your local copy of each branch and flag them for removal from the remote during the next `jj git push`.
- sea-gold 2y agoA tool such as git-delete-merged-branches[1] may also be helpful. [1]: https://github.com/hartwork/git-delete-merged-branches https://github.com/hartwork/git-delete-merged-branches