HUIJZER.XYZ

GitHub and GitLab commands cheatsheet

2020-12-16

Both GitHub and GitLab provide shortcuts for interacting with the layers they have built on top of Git. These shortcuts are a convenient and clean way to interact with things like issues and PRs. For instance, using Fixes #2334 in a commit message will close issue #2334 automatically when the commit is applied to the main branch. However, the layers on top of Git differ between the two, and therefore the commands will differ as well. This document is a cheatsheet for issue closing commands; I plan to add more of these commands over time.

If this page contains outdated information, suggest a fix via GitHub.

  1. Close an issue via a pull request title or commit message
    1. GitHub
    2. GitLab

Close an issue via a pull request title or commit message

GitHub

On GitHub use (docs):

Examples

Fix #2334
Fix octo-org/octo-repo#2334
Fix #2334, fix octo-org/octo-repo#2334


GitLab

On GitLab use (docs):

Examples

Fixes #2334
Closes #2334
Closes #4, #6
Closes group/project#123