Carolyn Van Slyck

git wip: What the heck was I just doing?

Seal wondering 'When you walk into a room and forget what you were going to do in there'

Have you ever run git branch and still wasn’t sure what each one is for and if it’s recent? Here’s a git alias, git wip, that displays your branches and when you last changed them. It’s really useful for remembering which one you were just working on, and which branches probably should be deleted.


sample git wip command output

Edit your ~/.gitconfig file (or create one if you don’t have it) and add the following lines. If you already have an alias section, add this to the existing section:

The branches are sorted in descending order so that you will see the most recent branches at the bottom. Just in case you have so many that the output scrolls, you can still see the most recent branches. Not that I would ever have so many old branches lying around or anything that I’d need that… 😇