recent-branches – a quick git command

I’m often switching between the same few branches in git – whether I’ve been distracted by doing a quick fix in another branch, or am doing a code review on a colleague’s branch – and get frustrated with having to type out the name of said branches all the time.

With that in mind, I created a quick ruby script that will show me my most recently checked-out branches (up to a limit of my choosing) and allow me to check one out quickly by typing a number.

As mentioned, the limit can be set by the user, simply by adding the key ‘recent.limit’ to the git config (either –global or in the current project) with an appropriate number.

If this sounds useful, grab the code here:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s