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!