git push fails with remote: error: hook declined to update refs/heads/master

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
8
down vote

favorite
1












I'm recently trying to start my own project on a community git repo, and I've been having some complications. I'm new to git, but here's what I've been trying to do to just test it.



I run the following commands and they all run ok.



git config --global user.name "MYNAME"
git config --global user.email "MYEMAIL"
mkdir testproject
cd testproject
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git@git.xxxxx.org:community/testproject.git


and all of the above commands run with no error. However, when I the run the next command I get a huge error.



git push -u origin master


and the error is.



Counting objects: 3, done.
Writing objects: 100% (3/3), 204 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
Username for 'http://git.xxxxxx.org': MYEMAIL
Password for 'http://MYEMAIL.com@git.xxxxxx.org':
remote: /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find rake-10.1.0 in any of the sources (Bundler::GemNotFound)
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `map!'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `materialize'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:159:in `specs_for'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:148:in `requested_specs'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/environment.rb:18:in `requested_specs'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:13:in `setup'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/setup.rb:17:in `<top (required)>'
remote: from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
remote: from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
remote: error: hook declined to update refs/heads/master
To http://git.xxxxxx.org/community/testproject.git
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'http://git.xxxxxx.org/community/testprojact.git'


I'm not really sure what to do from here, but any help is much appreciated.



Also, I'm running Arch if it matters.



Edit:
I've tried re-installing rake and it didn't work. My current version of rake was 10.1.1, so I tried removing it and replacing it with version 10.1.0 and that also didn't fix it.



However when I was installing rake, I got an error:



WARNING: You don't have /home/josh/.gem/ruby/2.0.0/bin in your PATH,
gem executables will not run.


Could this be contributing to the problem?










share|improve this question



























    up vote
    8
    down vote

    favorite
    1












    I'm recently trying to start my own project on a community git repo, and I've been having some complications. I'm new to git, but here's what I've been trying to do to just test it.



    I run the following commands and they all run ok.



    git config --global user.name "MYNAME"
    git config --global user.email "MYEMAIL"
    mkdir testproject
    cd testproject
    git init
    touch README
    git add README
    git commit -m 'first commit'
    git remote add origin git@git.xxxxx.org:community/testproject.git


    and all of the above commands run with no error. However, when I the run the next command I get a huge error.



    git push -u origin master


    and the error is.



    Counting objects: 3, done.
    Writing objects: 100% (3/3), 204 bytes | 0 bytes/s, done.
    Total 3 (delta 0), reused 0 (delta 0)
    Username for 'http://git.xxxxxx.org': MYEMAIL
    Password for 'http://MYEMAIL.com@git.xxxxxx.org':
    remote: /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find rake-10.1.0 in any of the sources (Bundler::GemNotFound)
    remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `map!'
    remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `materialize'
    remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs'
    remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:159:in `specs_for'
    remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:148:in `requested_specs'
    remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/environment.rb:18:in `requested_specs'
    remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:13:in `setup'
    remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
    remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/setup.rb:17:in `<top (required)>'
    remote: from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    remote: from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    remote: error: hook declined to update refs/heads/master
    To http://git.xxxxxx.org/community/testproject.git
    ! [remote rejected] master -> master (hook declined)
    error: failed to push some refs to 'http://git.xxxxxx.org/community/testprojact.git'


    I'm not really sure what to do from here, but any help is much appreciated.



    Also, I'm running Arch if it matters.



    Edit:
    I've tried re-installing rake and it didn't work. My current version of rake was 10.1.1, so I tried removing it and replacing it with version 10.1.0 and that also didn't fix it.



    However when I was installing rake, I got an error:



    WARNING: You don't have /home/josh/.gem/ruby/2.0.0/bin in your PATH,
    gem executables will not run.


    Could this be contributing to the problem?










    share|improve this question

























      up vote
      8
      down vote

      favorite
      1









      up vote
      8
      down vote

      favorite
      1






      1





      I'm recently trying to start my own project on a community git repo, and I've been having some complications. I'm new to git, but here's what I've been trying to do to just test it.



      I run the following commands and they all run ok.



      git config --global user.name "MYNAME"
      git config --global user.email "MYEMAIL"
      mkdir testproject
      cd testproject
      git init
      touch README
      git add README
      git commit -m 'first commit'
      git remote add origin git@git.xxxxx.org:community/testproject.git


      and all of the above commands run with no error. However, when I the run the next command I get a huge error.



      git push -u origin master


      and the error is.



      Counting objects: 3, done.
      Writing objects: 100% (3/3), 204 bytes | 0 bytes/s, done.
      Total 3 (delta 0), reused 0 (delta 0)
      Username for 'http://git.xxxxxx.org': MYEMAIL
      Password for 'http://MYEMAIL.com@git.xxxxxx.org':
      remote: /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find rake-10.1.0 in any of the sources (Bundler::GemNotFound)
      remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `map!'
      remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `materialize'
      remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs'
      remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:159:in `specs_for'
      remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:148:in `requested_specs'
      remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/environment.rb:18:in `requested_specs'
      remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:13:in `setup'
      remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
      remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/setup.rb:17:in `<top (required)>'
      remote: from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
      remote: from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
      remote: error: hook declined to update refs/heads/master
      To http://git.xxxxxx.org/community/testproject.git
      ! [remote rejected] master -> master (hook declined)
      error: failed to push some refs to 'http://git.xxxxxx.org/community/testprojact.git'


      I'm not really sure what to do from here, but any help is much appreciated.



      Also, I'm running Arch if it matters.



      Edit:
      I've tried re-installing rake and it didn't work. My current version of rake was 10.1.1, so I tried removing it and replacing it with version 10.1.0 and that also didn't fix it.



      However when I was installing rake, I got an error:



      WARNING: You don't have /home/josh/.gem/ruby/2.0.0/bin in your PATH,
      gem executables will not run.


      Could this be contributing to the problem?










      share|improve this question















      I'm recently trying to start my own project on a community git repo, and I've been having some complications. I'm new to git, but here's what I've been trying to do to just test it.



      I run the following commands and they all run ok.



      git config --global user.name "MYNAME"
      git config --global user.email "MYEMAIL"
      mkdir testproject
      cd testproject
      git init
      touch README
      git add README
      git commit -m 'first commit'
      git remote add origin git@git.xxxxx.org:community/testproject.git


      and all of the above commands run with no error. However, when I the run the next command I get a huge error.



      git push -u origin master


      and the error is.



      Counting objects: 3, done.
      Writing objects: 100% (3/3), 204 bytes | 0 bytes/s, done.
      Total 3 (delta 0), reused 0 (delta 0)
      Username for 'http://git.xxxxxx.org': MYEMAIL
      Password for 'http://MYEMAIL.com@git.xxxxxx.org':
      remote: /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find rake-10.1.0 in any of the sources (Bundler::GemNotFound)
      remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `map!'
      remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `materialize'
      remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs'
      remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:159:in `specs_for'
      remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:148:in `requested_specs'
      remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/environment.rb:18:in `requested_specs'
      remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:13:in `setup'
      remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
      remote: from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/setup.rb:17:in `<top (required)>'
      remote: from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
      remote: from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
      remote: error: hook declined to update refs/heads/master
      To http://git.xxxxxx.org/community/testproject.git
      ! [remote rejected] master -> master (hook declined)
      error: failed to push some refs to 'http://git.xxxxxx.org/community/testprojact.git'


      I'm not really sure what to do from here, but any help is much appreciated.



      Also, I'm running Arch if it matters.



      Edit:
      I've tried re-installing rake and it didn't work. My current version of rake was 10.1.1, so I tried removing it and replacing it with version 10.1.0 and that also didn't fix it.



      However when I was installing rake, I got an error:



      WARNING: You don't have /home/josh/.gem/ruby/2.0.0/bin in your PATH,
      gem executables will not run.


      Could this be contributing to the problem?







      git ruby






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 21 '13 at 23:04









      Gilles

      516k12210271555




      516k12210271555










      asked Dec 21 '13 at 3:52









      Joshua Strot

      2341212




      2341212




















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          9
          down vote



          accepted










          That the remote declined to receive the data is only a side effect of the real problem -- git thinks that it was denied because one of the hooks on the remote end failed with an exit status >0 (you can see what it was in the Ruby traceback). It seems that one of the hooks tries to use rake, and can't find it. This is not a problem with your specific repo, probably. That message is also not from your local computer -- notice that it is prefixed with "remote", it is the remote that is missing rake, so probably only a sysadmin on that side can fix the issue.



          I would suggest you contact whoever manages your community git repository.






          share|improve this answer




















          • That's exactly what I was thinking. None of the hooks in my git repo are active, and so far nothing I've done even seems to change the error or create new ones. I'll contact the owner of the repo and see if he has any information on the problem.
            – Joshua Strot
            Dec 21 '13 at 5:33











          • Turn out the problem was, I was trying to push over the HTTP method which is unsupported on their GitLab. You have to push over SSH instead, which works wonderfully. I've got to say, I didn't expect that,
            – Joshua Strot
            Dec 21 '13 at 10:54

















          up vote
          0
          down vote













          I believe this is your issue.



          remote: error: hook declined to update refs/heads/master
          To http://git.xxxxxx.org/community/testproject.git
          ! [remote rejected] master -> master (hook declined)


          Search for this error I came across this Q&A on SO, titled: error: hook declined to update refs/heads/external_pub while pushing a branch.



          It would appear that there's a git hook on the server that's rejecting the push.



          excerpt




          Server-Side Hooks



          In addition to the client-side hooks, you can use a couple of important server-side hooks as a system administrator to enforce nearly any kind of policy for your project. These scripts run before and after pushes to the server. The pre hooks can exit non-zero at any time to reject the push as well as print an error message back to the client; you can set up a push policy that’s as complex as you wish.




          To determine why you're getting this error message you'll need to figure out which hook is tripping you up. Hooks are stored in the hooks folder inside the git folder (on the remote server end) - find the pre-receive hook or update hook and check to see what's causing your problem.






          share|improve this answer






















          • Inside of my hooks folder, I have multiple files with the .sample extension. I don't have a pre-receive hook, however there is a update hook. Since they all have the .sample extension though, I don't believe any of them are in use, so could it be that it's a hook on the server that's rejecting me? I looked online and there's a couple of people with my problem that have fixed it by doing various things, none of which fixed it in my case.
            – Joshua Strot
            Dec 21 '13 at 5:25

















          up vote
          0
          down vote













          Check role/group and permission in GIT repository
          My case, only red permission and its resolved after read/write access provided by GIT repository team





          share








          New contributor




          Radhakrishnan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.

















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f106113%2fgit-push-fails-with-remote-error-hook-declined-to-update-refs-heads-master%23new-answer', 'question_page');

            );

            Post as a guest






























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            9
            down vote



            accepted










            That the remote declined to receive the data is only a side effect of the real problem -- git thinks that it was denied because one of the hooks on the remote end failed with an exit status >0 (you can see what it was in the Ruby traceback). It seems that one of the hooks tries to use rake, and can't find it. This is not a problem with your specific repo, probably. That message is also not from your local computer -- notice that it is prefixed with "remote", it is the remote that is missing rake, so probably only a sysadmin on that side can fix the issue.



            I would suggest you contact whoever manages your community git repository.






            share|improve this answer




















            • That's exactly what I was thinking. None of the hooks in my git repo are active, and so far nothing I've done even seems to change the error or create new ones. I'll contact the owner of the repo and see if he has any information on the problem.
              – Joshua Strot
              Dec 21 '13 at 5:33











            • Turn out the problem was, I was trying to push over the HTTP method which is unsupported on their GitLab. You have to push over SSH instead, which works wonderfully. I've got to say, I didn't expect that,
              – Joshua Strot
              Dec 21 '13 at 10:54














            up vote
            9
            down vote



            accepted










            That the remote declined to receive the data is only a side effect of the real problem -- git thinks that it was denied because one of the hooks on the remote end failed with an exit status >0 (you can see what it was in the Ruby traceback). It seems that one of the hooks tries to use rake, and can't find it. This is not a problem with your specific repo, probably. That message is also not from your local computer -- notice that it is prefixed with "remote", it is the remote that is missing rake, so probably only a sysadmin on that side can fix the issue.



            I would suggest you contact whoever manages your community git repository.






            share|improve this answer




















            • That's exactly what I was thinking. None of the hooks in my git repo are active, and so far nothing I've done even seems to change the error or create new ones. I'll contact the owner of the repo and see if he has any information on the problem.
              – Joshua Strot
              Dec 21 '13 at 5:33











            • Turn out the problem was, I was trying to push over the HTTP method which is unsupported on their GitLab. You have to push over SSH instead, which works wonderfully. I've got to say, I didn't expect that,
              – Joshua Strot
              Dec 21 '13 at 10:54












            up vote
            9
            down vote



            accepted







            up vote
            9
            down vote



            accepted






            That the remote declined to receive the data is only a side effect of the real problem -- git thinks that it was denied because one of the hooks on the remote end failed with an exit status >0 (you can see what it was in the Ruby traceback). It seems that one of the hooks tries to use rake, and can't find it. This is not a problem with your specific repo, probably. That message is also not from your local computer -- notice that it is prefixed with "remote", it is the remote that is missing rake, so probably only a sysadmin on that side can fix the issue.



            I would suggest you contact whoever manages your community git repository.






            share|improve this answer












            That the remote declined to receive the data is only a side effect of the real problem -- git thinks that it was denied because one of the hooks on the remote end failed with an exit status >0 (you can see what it was in the Ruby traceback). It seems that one of the hooks tries to use rake, and can't find it. This is not a problem with your specific repo, probably. That message is also not from your local computer -- notice that it is prefixed with "remote", it is the remote that is missing rake, so probably only a sysadmin on that side can fix the issue.



            I would suggest you contact whoever manages your community git repository.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Dec 21 '13 at 5:29









            Chris Down

            77.2k12184197




            77.2k12184197











            • That's exactly what I was thinking. None of the hooks in my git repo are active, and so far nothing I've done even seems to change the error or create new ones. I'll contact the owner of the repo and see if he has any information on the problem.
              – Joshua Strot
              Dec 21 '13 at 5:33











            • Turn out the problem was, I was trying to push over the HTTP method which is unsupported on their GitLab. You have to push over SSH instead, which works wonderfully. I've got to say, I didn't expect that,
              – Joshua Strot
              Dec 21 '13 at 10:54
















            • That's exactly what I was thinking. None of the hooks in my git repo are active, and so far nothing I've done even seems to change the error or create new ones. I'll contact the owner of the repo and see if he has any information on the problem.
              – Joshua Strot
              Dec 21 '13 at 5:33











            • Turn out the problem was, I was trying to push over the HTTP method which is unsupported on their GitLab. You have to push over SSH instead, which works wonderfully. I've got to say, I didn't expect that,
              – Joshua Strot
              Dec 21 '13 at 10:54















            That's exactly what I was thinking. None of the hooks in my git repo are active, and so far nothing I've done even seems to change the error or create new ones. I'll contact the owner of the repo and see if he has any information on the problem.
            – Joshua Strot
            Dec 21 '13 at 5:33





            That's exactly what I was thinking. None of the hooks in my git repo are active, and so far nothing I've done even seems to change the error or create new ones. I'll contact the owner of the repo and see if he has any information on the problem.
            – Joshua Strot
            Dec 21 '13 at 5:33













            Turn out the problem was, I was trying to push over the HTTP method which is unsupported on their GitLab. You have to push over SSH instead, which works wonderfully. I've got to say, I didn't expect that,
            – Joshua Strot
            Dec 21 '13 at 10:54




            Turn out the problem was, I was trying to push over the HTTP method which is unsupported on their GitLab. You have to push over SSH instead, which works wonderfully. I've got to say, I didn't expect that,
            – Joshua Strot
            Dec 21 '13 at 10:54












            up vote
            0
            down vote













            I believe this is your issue.



            remote: error: hook declined to update refs/heads/master
            To http://git.xxxxxx.org/community/testproject.git
            ! [remote rejected] master -> master (hook declined)


            Search for this error I came across this Q&A on SO, titled: error: hook declined to update refs/heads/external_pub while pushing a branch.



            It would appear that there's a git hook on the server that's rejecting the push.



            excerpt




            Server-Side Hooks



            In addition to the client-side hooks, you can use a couple of important server-side hooks as a system administrator to enforce nearly any kind of policy for your project. These scripts run before and after pushes to the server. The pre hooks can exit non-zero at any time to reject the push as well as print an error message back to the client; you can set up a push policy that’s as complex as you wish.




            To determine why you're getting this error message you'll need to figure out which hook is tripping you up. Hooks are stored in the hooks folder inside the git folder (on the remote server end) - find the pre-receive hook or update hook and check to see what's causing your problem.






            share|improve this answer






















            • Inside of my hooks folder, I have multiple files with the .sample extension. I don't have a pre-receive hook, however there is a update hook. Since they all have the .sample extension though, I don't believe any of them are in use, so could it be that it's a hook on the server that's rejecting me? I looked online and there's a couple of people with my problem that have fixed it by doing various things, none of which fixed it in my case.
              – Joshua Strot
              Dec 21 '13 at 5:25














            up vote
            0
            down vote













            I believe this is your issue.



            remote: error: hook declined to update refs/heads/master
            To http://git.xxxxxx.org/community/testproject.git
            ! [remote rejected] master -> master (hook declined)


            Search for this error I came across this Q&A on SO, titled: error: hook declined to update refs/heads/external_pub while pushing a branch.



            It would appear that there's a git hook on the server that's rejecting the push.



            excerpt




            Server-Side Hooks



            In addition to the client-side hooks, you can use a couple of important server-side hooks as a system administrator to enforce nearly any kind of policy for your project. These scripts run before and after pushes to the server. The pre hooks can exit non-zero at any time to reject the push as well as print an error message back to the client; you can set up a push policy that’s as complex as you wish.




            To determine why you're getting this error message you'll need to figure out which hook is tripping you up. Hooks are stored in the hooks folder inside the git folder (on the remote server end) - find the pre-receive hook or update hook and check to see what's causing your problem.






            share|improve this answer






















            • Inside of my hooks folder, I have multiple files with the .sample extension. I don't have a pre-receive hook, however there is a update hook. Since they all have the .sample extension though, I don't believe any of them are in use, so could it be that it's a hook on the server that's rejecting me? I looked online and there's a couple of people with my problem that have fixed it by doing various things, none of which fixed it in my case.
              – Joshua Strot
              Dec 21 '13 at 5:25












            up vote
            0
            down vote










            up vote
            0
            down vote









            I believe this is your issue.



            remote: error: hook declined to update refs/heads/master
            To http://git.xxxxxx.org/community/testproject.git
            ! [remote rejected] master -> master (hook declined)


            Search for this error I came across this Q&A on SO, titled: error: hook declined to update refs/heads/external_pub while pushing a branch.



            It would appear that there's a git hook on the server that's rejecting the push.



            excerpt




            Server-Side Hooks



            In addition to the client-side hooks, you can use a couple of important server-side hooks as a system administrator to enforce nearly any kind of policy for your project. These scripts run before and after pushes to the server. The pre hooks can exit non-zero at any time to reject the push as well as print an error message back to the client; you can set up a push policy that’s as complex as you wish.




            To determine why you're getting this error message you'll need to figure out which hook is tripping you up. Hooks are stored in the hooks folder inside the git folder (on the remote server end) - find the pre-receive hook or update hook and check to see what's causing your problem.






            share|improve this answer














            I believe this is your issue.



            remote: error: hook declined to update refs/heads/master
            To http://git.xxxxxx.org/community/testproject.git
            ! [remote rejected] master -> master (hook declined)


            Search for this error I came across this Q&A on SO, titled: error: hook declined to update refs/heads/external_pub while pushing a branch.



            It would appear that there's a git hook on the server that's rejecting the push.



            excerpt




            Server-Side Hooks



            In addition to the client-side hooks, you can use a couple of important server-side hooks as a system administrator to enforce nearly any kind of policy for your project. These scripts run before and after pushes to the server. The pre hooks can exit non-zero at any time to reject the push as well as print an error message back to the client; you can set up a push policy that’s as complex as you wish.




            To determine why you're getting this error message you'll need to figure out which hook is tripping you up. Hooks are stored in the hooks folder inside the git folder (on the remote server end) - find the pre-receive hook or update hook and check to see what's causing your problem.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited May 23 '17 at 12:40









            Community♦

            1




            1










            answered Dec 21 '13 at 5:18









            slm♦

            241k66501669




            241k66501669











            • Inside of my hooks folder, I have multiple files with the .sample extension. I don't have a pre-receive hook, however there is a update hook. Since they all have the .sample extension though, I don't believe any of them are in use, so could it be that it's a hook on the server that's rejecting me? I looked online and there's a couple of people with my problem that have fixed it by doing various things, none of which fixed it in my case.
              – Joshua Strot
              Dec 21 '13 at 5:25
















            • Inside of my hooks folder, I have multiple files with the .sample extension. I don't have a pre-receive hook, however there is a update hook. Since they all have the .sample extension though, I don't believe any of them are in use, so could it be that it's a hook on the server that's rejecting me? I looked online and there's a couple of people with my problem that have fixed it by doing various things, none of which fixed it in my case.
              – Joshua Strot
              Dec 21 '13 at 5:25















            Inside of my hooks folder, I have multiple files with the .sample extension. I don't have a pre-receive hook, however there is a update hook. Since they all have the .sample extension though, I don't believe any of them are in use, so could it be that it's a hook on the server that's rejecting me? I looked online and there's a couple of people with my problem that have fixed it by doing various things, none of which fixed it in my case.
            – Joshua Strot
            Dec 21 '13 at 5:25




            Inside of my hooks folder, I have multiple files with the .sample extension. I don't have a pre-receive hook, however there is a update hook. Since they all have the .sample extension though, I don't believe any of them are in use, so could it be that it's a hook on the server that's rejecting me? I looked online and there's a couple of people with my problem that have fixed it by doing various things, none of which fixed it in my case.
            – Joshua Strot
            Dec 21 '13 at 5:25










            up vote
            0
            down vote













            Check role/group and permission in GIT repository
            My case, only red permission and its resolved after read/write access provided by GIT repository team





            share








            New contributor




            Radhakrishnan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.





















              up vote
              0
              down vote













              Check role/group and permission in GIT repository
              My case, only red permission and its resolved after read/write access provided by GIT repository team





              share








              New contributor




              Radhakrishnan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.



















                up vote
                0
                down vote










                up vote
                0
                down vote









                Check role/group and permission in GIT repository
                My case, only red permission and its resolved after read/write access provided by GIT repository team





                share








                New contributor




                Radhakrishnan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                Check role/group and permission in GIT repository
                My case, only red permission and its resolved after read/write access provided by GIT repository team






                share








                New contributor




                Radhakrishnan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.








                share


                share






                New contributor




                Radhakrishnan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                answered 7 mins ago









                Radhakrishnan

                1




                1




                New contributor




                Radhakrishnan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.





                New contributor





                Radhakrishnan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






                Radhakrishnan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f106113%2fgit-push-fails-with-remote-error-hook-declined-to-update-refs-heads-master%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Displaying single band from multi-band raster using QGIS

                    How many registers does an x86_64 CPU actually have?