
Github is where your code lives online, but it’s also so much more — a place where code, collaboration, documentation, and automation all come together.
I was introduced to it as a developer at Shopify, and even now, working on solo projects, I still find it incredibly useful.
Often, I do be working away on something and realise it would be great if there was a setting or automation for said thing. This posts includes some of those things.
Hero image by Richy Great on Unsplash.
Linking Issues to PRs
Something I touched on in My Git Workflow is how I prefix my branch names with the issue number, like: 45-fix-lazy-loading
.
A benefit of this approach is you immediately know what issue number is when creating the PR on Github. Therefore you can easily link the PR back to the issue by writing closes: #45
in the PR description.
When the PR merges, the issue is then auto-closed — such a simple win! Linking issues to PRs is something I didn’t know for aaages and more info on it can be seen in the GitHub docs.
Issue Templates
One of the first things I do when creating a repo is set up some Issue Templates. Github has some default ones, i.e. Bug report and Feature Request which contain a lot boilerplate. I usually strip out a lot of the fluff and have it fairly bare bones to begin with.
Having the ability to automatically add labels and part of the title, e.g. [Bug]
is useful too, especially on project boards where the labels might not be visible.
Projects
Like Issues, GitHub Projects have a ton of great templates to use — I’m a fan of kanban boards myself and it works quite well out of the gate, although I usually just have the No Status, Backlog, In Progress, Done columns. No real need for the Review column since I’m currently working solo 🙃
The thing that actually prompted me to write this post though is the project workflows.
At first, I was creating the issues then bulk adding them to the project. That was until I discovered there is a way to automatically add items to a project. For example, you could have a new feature issue template that automatically applies an enhancement
label, and this label can be used to automatically add the issue to a New Features
project. By default it will go in the No Status column.
I thought this was a bit hard to find as I was looking to set this up under Settings as opposed to Workflows. Haven’t looked back since though.
Search & Filtering
Okay, in fairness, Github has gotten a lot better at this as I notice there is a dropdown when you go to enter a search.
For a long time though, this wasn’t the case so it was handy to know about prefixing with -
for filtering results. For example, images -label:bug
would hide all the issues that have a bug
label. Particularly handy when search results are full of noise.
This is the kind of thing you’d only discover in a Stackoverflow post back in the day, but is now much more obvious — good job Github! (Update: Github have a good blog post about the updates).
Wrap-Up
That’s it for now — short and sweet. Just a few things that have helped me streamline how I use GitHub. Hopefully, a few of the tips here will make your GitHub life a little smoother too, and if I’m missing any obvious ones please let me know!
I have a companion piece to this which looks at the Git side of things over at My Git Workflow.
DavAI SummAIriser
Want a quick summary of this post?