Book Image

GitHub Essentials

By : Achilleas Pipinellis
Book Image

GitHub Essentials

By: Achilleas Pipinellis

Overview of this book

<p><span id="description" class="sugar_field">Whether you are an experienced developer or a novice, learning to work with Version Control Systems is a must in the software development world. Git is the most popular tool for that purpose and GitHub was built around it leveraging its powers by bringing it to the web.</span></p> <p><span id="description" class="sugar_field">Starting with the basics of creating a repository you will then learn how to manage the issue tracker, the place where discussion about your project takes place. Continuing our journey we will explore how to use the wiki and write rich documentation that will accompany your project. Organization and team management will be the next stop and then onto the feature that made GitHub so well known, Pull Requests. Next we focus on creating simple web pages hosted on GitHub and lastly we explore the settings that are configurable for a user and a repository.</span></p>
Table of Contents (13 chapters)

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 a commit message:

  • close

  • closes

  • closed

  • fix

  • fixes

  • fixed

  • resolve

  • resolves

  • resolved

Let's take, for example, an open issue like the following one and note down its number, which in this case is 2:

Then, make a commit, which in its message has one of the preceding...