This document describes how to lock files and folders in a code repository.
CODING allows you to lock files or paths of the Default Branch (usually the master branch) in code repositories. Only the user who locked the file can modify (edit or delete) it. If a user locks a path, all files in the path will be locked and can only be modified by the user who locked it.
Project admins can enter the project, click Project Settings in the lower-left corner, and go to Projects and Members > User Groups to set permissions for the repository. After setting the permissions, add team members to the relevant user groups to control the permissions to code repositories in the project.
Go to the Browse page of a project repository and select a file. Click the More Actions button in the upper-right corner and select Lock.
A padlock icon will appear after the file is locked. Only the member who locked this file can edit or delete it.
Select a folder in a repository, click the More Actions button in the upper-right corner, and then select Lock to lock all files in the path.
A locked file can only be edited/deleted by the user who locked the file. Only the user who locked the path can create/edit/delete files in it. If another user tries to modify the locked file by pushing, the push will fail.
In a merge request, if the target branch is the default branch and the directory to be written includes a locked file or path, the merge can only be performed by the user who locked the file or path. Other members cannot merge the branches.
A project member can unlock files or folders they locked on the Browse page; a member with permission to Unlock Locked Files can unlock files or folders locked by another user.
Project admins can view locked files/folders in Settings > File Locking. Click Delete to unlock the file or folder.