简体   繁体   中英

Error encountered while pushing branch to the remote repository: rejected master -> master (pre-receive hook declined)

I have a fresh repository on a github organization page where I'm trying to do an initial push of an existing code base. When I do, I get the following error:

Opening repositories:
D:\OneDrive\MyOrg\DevTeam\myFeature
Commit abcd123 created locally in repository D:\OneDrive\MyOrg\DevTeam\myFeature
Pushing master
Enumerating objects: 12310, done.
Delta compression using up to 8 threads
POST git-receive-pack (chunked)
Total 12310 (delta 8123), reused 0 (delta 0)
Pushing to https://github.com/MyOrg/myOrganization.git
To https://github.com/MyOrg/myOrganization.git
failed to push some refs to 'https://github.com/MyOrg/myOrganization.git'
Error encountered while pushing branch to the remote repository: rejected master -> master (pre-receive hook declined)

I've changed the names for obvious reasons, and I'm not too familiar with hooks. I did read from the following link on pre-receive server side hooks and what they are though: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks#Server-Side-Hooks and it appears to be a thing that the server side changes the rights or requirements to being able to push I believe? However, the github page and repo in itself are both fresh and untouched, so I'm not sure how these hooks would even be adjusted (even if I could, which idk if I can).

Thanks to anyone who can help!

There is no standard pre-receive hook on a bare GitHub repo, it must have been installed by your company ( GitHub docs ).

Check with your company what rules they have enforced; you may suggest them to add some more explicit messages to explain rejection.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM