I recently set up a new user on my laptop and still had a handful of old branches around. I’m sure my old user would have been way higher.
I went through the GitHub interface to prune old branches, but definitely need to look through some of the scripts and one-liner suggestions in this thread.
Killed about 25 local branches. Pruned 71 down to 14. Easy and quick win.
I am actually curious, I’ve always been warned to keep branches around a while after merging in case … something happens? In the 6 years I’ve been working professionally, I’ve see some pretty teeth clenching reverts and rollbacks, but never anything that required the old, already merged branch to be around. So I deleted my coworkers merged branches too. Is that taking it too far?
Removed 7 out of 11 local branches and 10 out of 16 remote branches. The rest are used for special versions.
Whenever I work on windows, I prefer using TortoiseGit to have a look at the branches (last commit date and messages) before deciding to delete branches.
I already see the benefits of the challenges both from the code-base perspective and from the commitment on my part to dedicate a bit of time, every day, 1st thing in the morning, to all those quality tasks that always seems to be pushed back…
I also find that 20 minutes/day are enough to have a taste of each challenge but I need around an hour to fully participate and expend a bit on each topic.
I find that doing the CQC as the first thing every day is key for me. Looking at emails before starting the challenge tend to drag me into answering emails that makes starting the daily challenge much more difficult…
I am so behind! Going 2 a days until I catch up . I didn’t have too many local branches needing trimming. My biggest problem is we have LOTS of remote branches that are merged but undeleted, or stale. I wasn’t ever able to come up with a way to get them all in one fell swoop.
Every time we merge a branch on github we use the “delete branch” button. Thanks github! As a result, I end up with a bunch of branches that I have locally but do not exist on remote.
Like many of the others posting here, I use this bash script regularly to clean up my local branches: