Commit Rules
Code commit rules can be set in CodeHub to ensure code quality.
To set code commit rules, choose
on the repository details page.The settings take effect only for the repository configured.
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. Signature mode: Add the -s parameter when performing the commit operation on the client. git commit -s -m "<your_commit_message>" You need to configure the signature and email address on the client in advance. |
Prevent tag removal by git push command to delete tags on the Git client, but can delete tags on the web UI. |
Tags cannot be deleted by the git push command. However, tags can still be deleted on the web UI. |
Prevent committing secrets |
For details, see Rejecting Encrypted 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 overwrite the cloud repository. In general cases, you are not advised using this command. |
Developers cannot create branches. |
A whitelist can be set to prevent developers not in the whitelist from creating branches. |
Developers cannot create tags. |
Indicates whether developers are forbidden to create tags. |
Allowed Commit Submission Information |
Only commit messages that match the defined regular expression rules, for example, ^fix #[0-9]+, are allowed to be pushed. If this field is left blank, any commit message is allowed. It is equivalent to a whitelist for committing messages. |
Prohibited Commit Submission Information |
Commit messages that match the defined regular expression rules, for example, ^test.+, are not allowed to be pushed. If this field is left blank, any commit message is allowed. It is equivalent to a blacklist for committing messages. |
Allowed Branch Names |
Only branch names that match the defined regular expression rules, for example, ^feature-[0-9a-zA-Z]+, are allowed to be pushed. If this field is left blank, any branch name is allowed. |
Prohibited File Names |
File names that match the defined regular expression rules, for example, ^*\.exe, are not allowed to be pushed. |
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