On this page
Help Center/ CodeArts Repo/ FAQs/ Uploading and Downloading Code/ "Error: Deny by project hooks setting 'default': message of commit" Is Reported When Code Repository Is Pushed from the Local Host to CodeArts Repo

"Error: Deny by project hooks setting 'default': message of commit" Is Reported When Code Repository Is Pushed from the Local Host to CodeArts Repo

Updated on 2025-03-27 GMT+08:00

Symptom

If the format of the code file to be pushed to the remote repository is not standard and the ticket number and modifier are not provided, the error information shown in the following figure is displayed.

Figure 1 Error information displayed when code is pushed

Analysis

The commit message does not match the regular-expression: ^\[maven-release-plugin\]|[Trouble ticket number or requirement ticket number]\s*.+\W[Modified description]\s*.+\W[Modified reason]\s*.+\W[Modules] \s*.+\W[Modifier]\s*.+\W[Approver]\s*.+

Figure 2 Commit message when code is pushed

Solution

  • To modify the latest incorrect commit message, perform the following operations.
  1. Perform the following operations to modify the latest incorrect commit message:

    Right-click the .git hidden folder and choose Open Git Bash here from the shortcut menu to open Git Bash.

  2. Run the git log command to find the incorrect commit message.
  3. Enter the information again according to the commit message specifications: ^\[maven-release-plugin\]|[Trouble ticket No. or requirement No.]\s*.+\W[Modification description]\s*.+\W[Modification reason]\s*.+\W[Module] \s*.+\W [Modified by] \s*.+\W [Approver] \s*.+. Run the git commit --amend -m'[Trouble ticket or requirement ticket ID] US20250211529 command and press Enter. Enter [Modification description] Test commit rules not qualified and press Enter. Enter [Modification reason] Test commit rules not qualified and press Enter. Enter [Module] example and press Enter. Enter [Modifier] example and press Enter. Enter [approver] Test'.

    Note that there is a space between the command text and the commit message in each line.

    This example indicates that the commit message set in CodeArts Repo includes the trouble ticket ID or requirement ID, modification description, modification reason, module, and modifier. Enter the information based on the your configuration settings.

  • For details about how to modify the commit record that was incorrectly written for the Nth last time, see the following example (the second last).
  1. Run the git log command on Git Bash to search for incorrect commit messages. As shown in the following figure, there are three commit records. If the second last commit message is modified, then the ID of the second commit is e7d52124aef603f2fe94b001435962c4ffa51be9.

  2. Run the git rebase -i HEAD~2 command. The commit ID to be modified is e7d5212. Change pick to edit and save the modification.
  3. Run 3 to apply the commit message modification.
Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback