问题
I am trying to push my app on to Heroku, but I am getting this error message. I have looked around, someone mentioned about GitHub recently started redirecting http repository access to https and it appears your git is unhappy about this change. But I am having troubles pushing to heroku, any help will be much appreciated.
error: RPC failed; result=22, HTTP code = 400
回答1:
This may occur due the reason that Heroku's Git doesn't understand shallow clone as mentioned here.
Workaround is to disable shallow clone before deployment.
git fetch --unshallow
回答2:
change your postbuffer
git config --global http.postBuffer 52428800
then you postbuffer is 50M .
回答3:
i hope this is not coming to late, but Heroku deployments require a full Git clone. By default, Pipelines clones your repository with a depth of 50 to shorten your build time. You can configure your Pipeline to do a full Git clone in your bitbucket-pipelines.yml file.
try adding full clone depth to your yml file
image: node:6
clone:
depth: full
回答4:
The problem (could be) that you are probably used git clone --depth .. for your repository and that created so called shallow copy (without history).
If you cloned somebody else repository (!), just delete /.git folder and create a recreate repository as new with
cd <my-project>/
git init
Then you can push even with remote https://<youprojectname>.herokuapp.com/
回答5:
It could be a glitch, as I mentioned in here.
(Actually, right as I write this, GitHub is having a "Major service outage"!)
Make sure you can reproduce the issue with an http or an https url.
If that persists, simply try and swith to an ssh url
git remote set-url heroku git@heroku.com:yourRepo
(which is the recommended approach, since heroku normally support ssh only)
回答6:
For Rails 4: make sure you add "rails_12factor" gem to your Gemfile.
来源:https://stackoverflow.com/questions/19449800/error-rpc-failed-result-22-http-code-400