Configuring Code Commit Rules
Configuring Repo-Level Commit Rules
CodeArts Repo allows you to create verification and restriction rules for code commits to ensure code quality. You can select Inherit from project to automatically inherit and use the project settings. The settings cannot be modified.
You can also access the CodeArts Repo homepage. Choose Settings > Policy Settings > Commit rules, and click Create Commit Rule. For details about the parameters, see Table 1
Parameter |
Description |
---|---|
Reject non-signed-off-by commits |
Only signed-off-by commits are 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. |
Reject commits not signed by GPG |
Only GPG-signed commits are pushed to the repository. Configure a GPG key: git config --global user.signingkey "your GPG private key" 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" When running the tag command on the Git client, you need to add the -s parameter. git tag -s -m "Your tag 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 |
Example: id_rsa and id_dsa 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 using this command. |
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