Updated on 2023-12-06 GMT+08:00

Repository Locking

When a new software version is ready for release, administrators can lock the repository to protect it from being compromised. After the repository is locked, no one (including the administrators) can commit code to any of its branches.

To lock a repository, choose Settings > Security Management > Repository Locking on the repository details page.

Only the repository administrator and owner can view the page and have the setting permission.

After the administrator locks the repository, no one can use the repository functions in Table 1.

Table 1 List of functions that cannot be executed

Tab Page

Function

Code

If the repository is locked, the following functions cannot be performed on the Code tab page:

  • Create, edit, delete, rename, and upload a file
  • Create and delete a directory
  • Create and delete a submodule
  • Cherry-Pick and revert a file
  • Add, delete, edit, reply, and resolve a review and comment

Branch & Tag

If the repository is locked, the following functions cannot be performed on the Branch or Tag subtab of the Code tab page:

  • Create, edit, and delete a branch, merge branches, and sett protected branches.
  • Create and delete a Tag

Merge Requests

If the repository is locked, the following functions cannot be performed on the Merge Requests details page:

  • Create, edit, close, re-open, and merge a merge request
  • Cherry-Pick and revert a merge request
  • Resolve a code conflict
  • Add, delete, edit, reply, and resolve a review comment

Repository & Members

If the repository is locked, the following functions cannot be performed:

  • Fork a repository
  • Add, delete, edit, and approve a member

Settings

If the repository is locked, the following functions cannot be performed on the Settings tab page:

  • Repository settings
  • Submodules
  • Deploy key synchronization
  • Space freeing
  • Policy settings (All)
  • Service integration (All)

After the repository is locked, changes to project members will be synchronized to the repository, affecting repository members.