failed to push some refs to git@heroku.com

后端 未结 27 2187
野性不改
野性不改 2020-12-02 10:10

I am getting this error when I am trying push my files into heroku rep.

Ive set autocrlf = false already in gitconfig but this problem is still there. i have also tr

相关标签:
27条回答
  • 2020-12-02 10:22

    please check if you have 2 lock files if yes then leave the package-lock.json and delete the other one like yarn.lock

    Then execute these commands.

    1. $ git add .
    2. $ git commit -m "yarn lock file removed"
    3. $ git push heroku master
    0 讨论(0)
  • 2020-12-02 10:23

    Make sure you’re pushing the right branch. I wasn’t on master and kept wondering why it was complaining :P

    0 讨论(0)
  • 2020-12-02 10:25

    You should check something

    1. Branch master was created in you git repository
    2. Config user.name and user.email
    3. Pull before push

    I hope it will work with you

    0 讨论(0)
  • 2020-12-02 10:26

    If your heroku project root is in a different directory than your git branch root, use this:

    git subtree push --prefix path/to/root heroku master

    0 讨论(0)
  • 2020-12-02 10:27

    For anyone arriving here from a Google search with the same error message. Also be aware that you can have a problem if you are using sqlite3

    https://devcenter.heroku.com/articles/sqlite3

    0 讨论(0)
  • 2020-12-02 10:28

    It would appear that you are not fully up-to-date. You would need to do a git pull and either "--rebase" or let it merge into your set.

    After this, you should then be able to push, since it would be a 'fast-forward' change that wouldn't remove history.

    Edit: example command list

    git pull
    git push
    
    0 讨论(0)
提交回复
热议问题