. Advertisement .
..3..
. Advertisement .
..4..
I get an error
git.exe push -v --progress "origin" iteration1:iteration1
remote: *********************************************************************
To ssh://git@mycogit/cit_pplus.git
! [remote rejected] iteration1 -> iteration1 (pre-receive hook declined)
error: failed to push some refs to 'ssh://git@mycogit/cit_pplus.git'
when trying to push a change I’ve commited. How to fix the [remote rejected] master -> master (pre-receive hook declined) error? Please give me some advice.
The cause:
It is possible you don’t have permission to push your commits into the
pre-receive
hook of the repo (it is an user-configurable script for analyzing incoming changes commits and deciding whether they are acceptable to be allowed into the repo or not).Solution:
Let’s ask the git@mycogit/cit_pplus.git maintainer who is in charge of maintaining the repo.
It’s also a smart idea to ask maintainer to update your hook so that it prints the reasons for rejection.
In case you’re the maintainer, perhaps the issue happens on the server-side. Please provide additional information for us.
It’s possible that you’re trying to push a slow-forward move, but the hook is blocking it. To rebase your local changes to the latest codebase, run
git pull --rebase
prior to pushing.