0

I received this error when trying to deploy my code to an existing app, using git push heroku master. I've deployed to this app plenty of times before, but all of a sudden, it's not working.

For some background on my app, I'm using a MERN stack. I am NOT using Bitbucket, which I think most or all of the similar posts are using, and I'm the admin (and sole developer) on this app, so it's not that I don't have the permissions, which is another issue I saw a lot. I also checked in my settings, and it says that the master branch is not protected (there are no protection rules), so I don't think I need to make it unprotected, which is something else that I saw suggested a lot.

It might have something to do with the fact that earlier today, I tried to push, and it said that I was out of space: Size of checkout and restored submodules exceeds 1 GB. Reduce size and try pushing again.

I followed some of the instructions here (https://thoughtbot.com/blog/how-to-reduce-a-large-heroku-compiled-slug-size#clean-up-the-git-repository) and ran heroku repo:gc --app your-app-name and heroku repo:purge_cache --app your-app-name.

I then tried to deploy again and got the above error instead: Git push error pre-receive hook declined

Any help would be appreciated, and happy to provide any other details that might be helpful! Thanks in advance!

  • Does this answer your question? [unable to push to Heroku after importing thousands of records](https://stackoverflow.com/questions/53643408/unable-to-push-to-heroku-after-importing-thousands-of-records). IT is related to BitBucket, not GitHub, but the problem isn't with the Git provider you're using, but with Heroku. The max repo size (history and all) must not exceed 1 GB – MindSwipe Nov 26 '20 at 06:36
  • Sadly, no. That only addresses the problem of if your repo is too large, but I don't think my repo is too large anymore. It's some other problem, since it's some other error. – athena517 Nov 26 '20 at 16:46
  • A pre-receive hook is any arbitrary command(s) you like, that you *add* to what Git itself does. They're not part of Git at all: Git just runs them. *They* choose whether to allow a `git push` operation to succeed, or to cut it off entirely, based on whatever is written in the hook program. So you need to examine the pre-receive hook, and see what it is doing. Why does it reject the attempt? What will make it happy? Can you remove the pre-receive hook entirely? (and so on) – torek Nov 26 '20 at 18:59
  • Can you elaborate on what that means and where to look for it? – athena517 Nov 27 '20 at 22:37

0 Answers0