Git submit code error husky > pre commit [How to Solve]

Reason: the keyword is husky > Baidu found the problem after pre-commit. It was really a file under. Git in the local project that caused the submission failure. This file is a pre-commit file.

Solution steps:

1. Find the .Git folder in the project (you need to display the hidden files before they appear. To display the hidden files: click View Options view show hidden files to confirm). Double click to enter and you can see some files about GIT

2. Go to the .Git folder, go to the hooks folder, and find the pre-commit file.

Pre-commit (client) hook, which will run to check the code style before git types the submission information
If the code does not comply with the corresponding rules, an error is reported.

3. After deleting the file, we commit and find that it can be submitted successfully.

Second question:

Prompt when git pushes: refs cannot be pushed to the remote end

Solution: pull the mainline code again, merge, resolve the conflict, resubmit, and then push to the remote end.

Read More: