O'Reilly logo

GitHub Essentials by Achilleas Pipinellis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Tips and tricks

So far, we explored the main functionality of pull requests. Let's see a couple of things that leverage their power even more.

Close issues via commit messages

In Chapter 1, Brief Repository Overview and Usage of the Issue Tracker, in the Tips and tricks section, you learned how to reference issues inside the issue tracker. Extending this ability, you can reference issue numbers in commit messages in order to close some issues when the commit is merged to the default branch.

For this action to be triggered, you have to use some keywords. For example, Closes #42 in the commit message will close issue 42 when that commit is merged with the default branch.

As per the GitHub documentation, the following keywords will close an issue via ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required