Image for

When's My Code Going Out?

At SpotX, we manage our codebase with Git. Our commits flow from our develop branch to production, with a code-freeze branch in-between. Like this:

Git branching

With any web application, it’s really important for developers to know when their code is going out. So they want to know which branch it’s on. To help with this, I created a few simple git aliases that show recent commits a developer has made in any branch. Here are the commands to create them:

$ git config --global 'rev-list origin/develop ^origin/freeze --pretty'
$ git config --global 'rev-list origin/freeze ^origin/prod --pretty'
$ git config --global 'rev-list origin/prod --pretty --after="14 days ago"'

Using them is easy!

$ git fetch
$ git my-freeze
commit bebba3afb108719bbdc500cb3dce50ffc062f060
Author: Mike Kasberg <>
Date:   Sun Apr 30 13:15:15 2017 -0600

    Write more code... Make another commit

commit 00a54a1d6cc80a7103389bc813c6d76c2014cd85
Author: Mike Kasberg <>
Date:   Sat Apr 29 11:16:44 2017 -0600

    Write some code... Make a commit

This is a really simple way to use a git alias to make branch management a little easier. With slight modification, it will help with pretty much any branching strategy - for example, you could get a list of commits written by you on a feature branch that are not yet in master:

$ git config --global 'rev-list origin/feature ^origin/master --pretty'

With a little customization, you can make an alias like this to help out with your own projects.


Did you like this blog post? Why not share it with your network!

About the Author

Mike Kasberg

👋 Hi, I'm Mike! I'm a husband, I'm a father, and I'm a senior software engineer at Strava. I use Ubuntu Linux daily at work and at home. And I enjoy writing about Linux, open source, programming, tech, and other random topics.