Referencing issues
You have created an issue in GitLab and are about to commit the code that solves a specific problem. You want to be able to reference that specific issue from your commit message, or even better, close that issue once the commit has been merged! In this recipe, we will take a look at the possibility of referencing issues and merge requests from your commits.
How to do it…
In the following steps, we will see how referencing works:
- Log in to GitLab.
- Go to the
super-git
project. - Create an issue in that project.
- To reference the issue in our commit messages, we must know the issue number. You can find it in the issue overview.
- Now, create a commit that will close this issue. To do this, go to the cloned project on our local machine.
- Before we make the actual change, make sure that your local repository is up to date:
git checkout master && git pull
- Now, create a feature branch in which we make this change:
git checkout -b bug-fix
- Make the change that will fix this nasty...