Deploying to heroku with git keeps getting rejected due to fast-forwards

前端 未结 3 1802
时光说笑
时光说笑 2021-02-02 09:00

I keep getting the following fail with heroku + git...

$ heroku jammit:deploy --app XXXXXXXXXXX
===== Compiling assets...[OK]
===== Commiting assets...[OK]
=====         


        
相关标签:
3条回答
  • 2021-02-02 09:46

    The problem is that changes have already been pushed and your commit is behind those newer pushes. I'm going to assume you have a master branch and your feature branch still, let's say it's called my_feature. You can do this and be okay:

    git checkout master
    git pull
    git checkout my_feature
    git rebase master
        (you may have to fix some conflicts here, if any are found)
    git checkout master
    git merge my_feature
    git push heroku
    

    You should remember to run any tests you have to make sure everything's good still.

    0 讨论(0)
  • 2021-02-02 09:48

    Just force the commit every time you push and it will push it even if there are fast-forward commits. We do this in our development Heroku server all the time since we're all pushing different commits (some further behind than others).

    git push -f git@heroku.com:picasso-staging.git
    

    I don't use jammit for deploying, but you could probably get away with force pushing first and then running the jammit task second. Or check and see if jammit supports a force push flag of some sort.

    0 讨论(0)
  • 2021-02-02 09:51
    git push -f REMOTE BRANCH:master #or just master
    

    Force it! Replace REMOTE with your heroku remote name (git remote -v to view all remotes). Replace BRANCH with the branch you want to push or just put "master" for the master branch.

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