0

I have a project on Heroku and I do some changes about the project and when I write to "git push heroku master" I get an error.

To https://git.heroku.com/webookapp.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://git.heroku.com/webookapp.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

I ran the following commands in order.

heroku git:remote -a webookapp
git add .
git commit -m "update"
git push heroku master
  • https://stackoverflow.com/search?q=%5Bgit%5D+hint%3A+Updates+were+rejected+because+the+remote+contains+work+that+you+do – phd Oct 23 '20 at 21:00

1 Answers1

1

git is telling you that the remote reference you are pushing to has changed and that you should update it first - Someone pushed their work before you and git needs you to retrieve that work to evaluate whether or not your work can be applied cleanly on top. The hint is in the hint:

This is usually caused by another repository pushing to the same ref. You may want to first integrate the remote changes(e.g., 'git pull ...') before pushing again.

hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Try git pull (you may need to resolve conflicts) and then git push again.

zrrbite
  • 1,180
  • 10
  • 22