Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

! [remote rejected] master -> master (pre-receive hook declined) [duplicate]

Tags:

Tasks: TOP => assets:precompile        (See full trace by running task with --trace)  !  !     Precompiling assets failed.  !   !     Push rejected, failed to compile Ruby app  To [email protected]:tranquil-crag-9767.git  ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to '[email protected]:tranquil-crag-9767.git' 

Any ideas why this is happening? I have checked that everything is properly set up, and the connection to git is good.

like image 454
user2918086 Avatar asked Feb 02 '14 21:02

user2918086


People also ask

How do you solve remote rejected main -> main pre receive Hook declined?

If your master branch is protected, you will get the gitlab ! [remote rejected] master -> master (pre-receive hook declined) error. Unprotect your master branch to solve the issue. If you can't push code directly to the master and get errors, you need to be the maintainer of the repo.

What does pre receive Hook declined mean?

The “hook declined” error can also occur if the user does not have an accurate access right. It means that they are unable to push a commit to the relevant branch (for example, master). It is important to note here that the branch that is being pushed can be protected.

Why would you use a pre receive hook in your remote repository?

Pre-receive hooks enforce rules for contributions before commits may be pushed to a repository. Pre-receive hooks run tests on code pushed to a repository to ensure contributions meet repository or organization policy. If the commit contents pass the tests, the push will be accepted into the repository.

How do you push origin master?

Whenever we need to push the changes to a remote repository, we use git push along with the remote repository “origin” and “master” branches. The term used is “git push origin master“. To pull the changes from the remote repository to local, we use git pull along with remote repository “origin” and “master” branch.


Video Answer


1 Answers

First try to pull your master from heroku.

$ git pull heroku master 

and then push it again. If you are still getting the same error then push your code with force

$ git push heroku master -f 
like image 147
Rahul Singh Avatar answered Sep 18 '22 21:09

Rahul Singh