Setup code owners
When contributing to a project, it can often be difficult to find out who should review or approve merge requests. Additionally, if you have a question about a specific file or code block, it may be difficult to know who to find the answer from.
You can use the GitLab Code Owners feature to define who owns specific files or paths in a repository, enabling other users to understand who is responsible for each file or path.
Next steps
-
Find a repository to add Code owners. Navigate to the repository you would like to add code owners to. -
Create a CODEOWNER
file. Using GitLab WebIDE, create and add aCODEOWNER
file in one of the 3 following places:- To the root directory of the repository
- Inside the
.gitlab/ directory
- Inside the
docs/ directory
-
Setup Code owners. Define code owners of specific file or path following this syntax: - File
[...]/file.md @username
. - Path
[...]/directory/ @username
. For more example see GitLab code owners file.
- File