Min Soe Han

LegalBusinessElse


backTech:


git: pre-received hook declined

DATE 20241013

git-pre-receive-error-e1

If you used git config credential.helper store for many repos and multiple users, you might encounter the error of the image saying that

! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://codeberg.org/minsoehan/pages.git'

The quick solution, although it cannot be recommended as proper solution, is to remove the following from your ./.git/config file in your repo.

[credential]
        helper = store

To get rid of typing your password, put your username and password at the line of url = https://example.com/username/reponame.git in the ./.git/config file as follows.

[remote "origin"]
        url = https://username:password@github.com/username/reponame.git
        fetch = +refs/heads/*:refs/remotes/origin/*