12

I know we can mention issue in commit messages as'#issue_no', but is it possible to link it to another commit in gitlab?

either mention commit SHA or complete commit URL in the commit message?

0

1 Answer 1

22

See the documentation: https://docs.gitlab.com/user/markdown/#gitlab-specific-references

References Input Cross-project reference Shortcut inside the same namespace
Commit (specific) 9ba12248 namespace/project@9ba12248 project@9ba12248

So you can just use the commit hash within one project.

Sign up to request clarification or add additional context in comments.

2 Comments

This applies if the commit is in the same project. Commits in other projects of the same Gitlab instance can also be cross-referenced with the full link or sth. like namespace/project@9ba12248.
In some workflows, commit hashes can change. That's why a slightly more verbose style of a reference to a commit is also used: git log -1 --format=reference. See section "PRETTY FORMATS" in documentation of git log.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.