X
Popular Searches

How to Link a Commit From a Github Issue

The GitHub logo.

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.

github click on commits

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.

github find hash

Paste it into your commit message.

github paste hash

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.

github issue linked

Not saying that happened in this case. Daily.

Lowell Heddings Lowell Heddings
Lowell is the founder and CEO of LifeSavvy Media. He’s been running the show since creating How-To Geek back in 2006. Over the last decade, Lowell has personally written more than 1000 articles which have been viewed by over 250 million people. Prior to starting How-To Geek, Lowell spent 15 years working in IT doing consulting, cybersecurity, database management, and programming work. Read Full Bio »

The above article may contain affiliate links, which help support CloudSavvy IT.