Git sync is failing with error: pre-receive hook declined

After setting up git connector correctly once you enable git sync there might be a possibility that git sync doesn’t work and while checking the logs you might see something below entry:

Git Command failed [Unable to push changes to git repository [ssh://git@yourrepo.git].
Status reported by Remote is: **REJECTED_OTHER_REASON**and message is: 
**pre-receive hook** declined. Other info: Force push: true. Fast forward: true]

Reason: Pre-receive hooks enforce rules for contributions before commits may be pushed to a repository. Working with pre-receive hooks

Solution: Check with your GitHub server administrator if there is any pre receive policy is configured for the repo/branch you are using and also check the user account which is being used in connector has the required permission.
Enforcing policy with pre-receive hooks

3 Likes