If you’re a developer working on a project on Github, you may have noticed that there are often commits made to different issues. This is because developers work on projects in order to complete tasks and then submit them for review. Once the issue has been reviewed and the task has been completed, the commit is made to the issue and it can be seen by other developers working on the project. In order to link a commit from an issue on Github, you first need to create a new branch for your project. Then, you need to add a link to the commit in your branch. To do this, use the following command: git add -L git push origin my-new-branch This will add a link to the commit in your branch and push it up to your repository. You can then use git status to see if there is a change backported from your old branch: git status -b my-old-branch # shows that there was no change backported from my-new-branch


We’ve all done it—we excitedly push a commit to solve an issue, leave a useful comment like “doh!”, and then forget to reference the Github issue number. Now they won’t be linked together… or will they?

Luckily you can easily reference a commit in a Github issue by simply pasting in the hash which will automatically turn into a link. Most of you already know how to do that, but for everybody else, we’ll detail the couple of steps.

First go find the commit in your repository. That’s easy enough, just click that “X commits” link.

Now locate the actual commit, which you can usually find by the useful commit message you left. In our case, there’s like 37 commits that all say “Doh!” so we’ll just grab the last one. Click the clipboard icon to copy the hash to the clipboard.

Paste it into your commit message.

And voila! The commit message magically gets turned into a link to the place where you fixed a very stupid bug that you should have caught during testing but you forgot to test and pushed it straight to production because you’re the best.

Not saying that happened in this case. Daily.