If you use GitHub at your company and have more than one project on the go at once, you might start to notice you get a lot, A LOT of emails. You get email notifications of pull requests being created, people commenting, people mentioning your name, people merging or closing pull requests... you get the idea. In this post I lay out how I manage my Github emails using Gmail to turn all of this noise into something useful.

Enjoy the freedom of having an inbox clear of these notifications (but still be within easy reach), and sneakily move you towards inbox zero wether you believe in it or not. Clearing up these emails will give you the freedom to see those notifications that are important and if you find the spare time, peruse those that aren't so urgent.

First thing, you're thinking HUH what email notifications?? Well they're probably going to your personal email you originally signed up for GitHub with, you know the one you never check anymore because log(n^n) emails. You need to know which inbox your notifications are going to. If you are a member of an organisation you can choose separate email addresses for each organisations notifications. Lets fix that.

GitHub > Settings > Notification center

Now we're all on the same page lets get cleansing.

First up we filter for all notifications from github and put them in their own folder. To do this we need to create a new filter.

You want to filter From notifications@github.com, this will include of all the different pull requests & comments etc that we talk about above.
You also want to filter Doesn't have for your Github handle and any global Github handles your company uses. (This will make more sense in a minute - keep reading!)

Hit continue.

You want to skip the inbox so that it goes straight to our new folder. Then you want to apply the label and this is what will move it to the folder of choice. Here we are putting it inside of /PullRequests/

We're close to perfection, the above is the basic outline of filtering and we will rinse and repeat with different paramaters to setup our full clean inbox setup.

Create a second filter. This one also filters From notifications@github.com. The difference is we also filter to Includes the words using our GitHub handle and any global handles (the opposite of our previous filter).

Hit continue

Skip the inbox again and apply the label. This label (folder) is a subdirectory of our previous filter. So this time we use _/PullReqests/Ref Me/. Therefore this folder will be every notifcation from Github that directly affects me or talks about me.

I know what you're thinking - "yes but what about MY project ME ME ME ME. The company has many projects with a lot of notifications. I am interested in notifications from my project but not those other phhht inferior projects".

Don't worrry, we've got you covered. Create another filter. This time we use the Subject field. Every notification from Github has a subject line that begins with the project name in square brackets. Therefore I can filter here for my project that I work on by using [project name].

Don't forget to put it into a subdirectory of /PullRequests/, a folder with the name of the project might be a good idea.

Here comes the freedom I promised you. Cherish it.
Now your inbox folders should look something like this. One tip is to work through these folders backwards. You always want to check Ref Me as this is direct conversation you are involved with on GitHub. Check Your Project when you find time in your project :-) and check PullRequests at your leisure to see what is going on in your organisation.

Last thing. Every Monday morning, go into the PullRequests folder, select all and delete. Believe me you will NEVER get through all these emails and the older they are the more worthless they are. Do your self a favor and start a fresh every week. If you don't believe me try it for a month and tell me if you are losing out, or if you actually gain and feel fresher and better and more informed.

This is not the only way to do filtering so feel free to berate me and show me how your filterings are n times better than this. Otherwise for those more pragmatic out there, give it a go, iterate and improve.