Commit Rules
To configure commit rules, you can choose
on the repository details page.On the Commit Rules page, you can establish a series of code commit verification and restriction rules to ensure code quality. The settings take effect only for the configured repository.
Only the repository administrators and owners can view this tab page and configure code commit rules.
Parameter |
Description |
---|---|
Reject unsigned commits |
Only signed commits can be pushed to the repository. CodeArts Repo signature mode: When performing online commit in CodeArts Repo, use the following format to compile and submit information: commit message # Enter the customized submission information. # This is a blank line. Signed-off-by: User-defined signature # Enter the user-defined signature after Signed-off-by: Git client signature mode: When running the commit command on the Git client, you need to add the -s parameter. git commit -s -m "<your commit message>" You need to configure the signature and email address on the client in advance. |
Tags cannot be deleted |
After this option is selected, tags cannot be deleted on the page or by running commands on the client. |
Prevent committing secrets |
Confidential files include ssh_server_rsa, id_rsa, and id_dsa. For details, see Description of Confidential Files. |
Prevent git push -f |
Indicates whether users can run the git push -f command on the client to push code. git push -f indicates that the current local code repository is pushed to and overwrites the code in CodeArts Repo. In general cases, you are not advised to use this command. |
Creating a Commit Rule
The repository administrator and repository owner can create a commit rule for a branch of the repository. Only one commit rule can be set for each branch.
Parameter |
Description |
---|---|
Rule Name |
This parameter is mandatory. The value contains a maximum of 200 characters. |
Branch |
This parameter is mandatory. Select a branch from the drop-down list or create a regular expression. This field supports a maximum of 500 characters. |
Commit rules |
Parameters in this area are optional.
|
Basic Attributes |
Parameters in this area are optional.
NOTE:
When a repository is created, the maximum size of a single file in the default submission rule (default) is 200 MB. When a repository is created, the recommended maximum size of a single file in the default submission rule is 50 MB. |
Binary Rules |
Parameters in this area are optional. These parameters are not set by default, indicating that binary files can be uploaded. The size of a single file cannot exceed the upper limit. Allow changes to binary files, Repo File Whitelist, and Privileged User take effect only when Do not allow new binary files is selected. If you select Allow changes to binary files, binary files in modifiable state are not intercepted and can be directly uploaded. Binary files can be deleted without binary check.
|
Effective Date |
This parameter is optional. Before being pushed, all commitments created after the date specified by this parameter must match the hook settings. If this parameter is left empty, all commitments are checked regardless of the committing date. |
You are not advised to store binary files in CodeArts Repo. Otherwise, the performance and stability of the code repository will be affected.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot