Git push solution:[ remote rejected] master -> master (pre-receive hook declined)
The day before yesterday, I was going to back out a version and push it to the remote branch, but I tried many times and couldn’t upload it. The error is as follows:
! [ remote rejected] master -> master (pre-receive hook declined)
Screenshot:
1. Turn off the protected permission of the branch where the content to be pushed is located
(1) Enter the settings of your project
(2) Click protected branches and unprotected to change the authority of the master branch, that is, to turn off the protected authority of the master
2. Create a new branch, push the project to the new branch, and merge later
(1) New branch
git branch name
(2) Switch branches
git checkout name
(3) Upload project
git add .
git commit -m "commit message"
git remote add origin remote repository address git push -u origin branch name
Similar Posts:
- Git Unable to switch remote branches error: pathspec ‘origin/XXXX’ did not match any file(s) known to git
- Git you are not allowed to push code to protected branches on this project?
- Git pull does not specify an error message for the branch
- Git clone download code prompts that the file pointed to by head does not exist
- [Solved] Git push origin master fatal: ‘origin’ does not appear to be a git repository fatal…
- [Git]fatal: You are not currently on a branch.
- Conflict resolution after git error non fast forward
- A rejected – non fast forward error occurred in eclipse push
- Git Pull Error: Please specify which branch you want to merge with.