Day 5 - Trim those branches
Episode 5 · November 16th, 2017 · 1 min 22 secs
About this Episode
This one is better read on the forum thread.
Congrats on reaching the end of week one!
It's Friday, so let's end with a quick win:
Run
git branch -r
. Marvel at all the old tracking branches that have been left in your local repo.Run
git remote prune origin
to delete the local tracking branches that don't exist onorigin
anymore. You might want to throw a--dry-run
on there to confirm that git is going to do the right thing.Re-run
git branch -r
. Better, right?Now that your local repo is clean, take a look at the branches on
origin
by runninggit ls-remote --heads origin
.Delete any of your branches that are no longer needed with
git push origin --delete old_branch
.Maybe bug your coworkers to do 4 and 5, too.
Enjoy the weekend!