Git forest and the lumberjack

2010-Nov-07

:

branch, branches, git, gitk, gitx, prune, version control, visualize

Git is great when it comes to branches. It’s quick and easy. However over time you’ll find yourself with a rather long list when it comes to running the `git branch` command since you were too lazy too clean up after yourself. Not to worry we’ll do a clean up and transform many branches to a few.

This is easy if you created all the branches and know exactly what each one contains and whether it’s been merged in or not. However this is not the case when rather old ‘dead’ branches, created by someone else with no relating ticket are present.

`gitk` to the rescue. However you find that under normal circumstances it’ll only display branches that are also on your current ancestral line of your checked out branch. You need to add the `–all` flag. So `gitk –all` which shows all branches. The same flag also exists if you’re using gitx for the mac.

This way you can visualize how old a branch is and do diffs to see if there’s any code you need. Then axe away any unneeded branches.

blog comments powered by Disqus