I can not update a Ruby project in Heroku with Git

0

When trying to commit some changes I made in my Ruby project and uploaded to Heroku, I had an error message.

Inside the project folder on the terminal I execute the commands:

$ git status
$ git add .
$ git commit -m 'msg'
$ git push heroku master

The following error was returned:

  

! [rejected] master - > master (fetch first) error: failed to   push some refs to ' link ' tip:   Updates were rejected because the remote contains work that you do   tip: not have locally. This is usually caused by another repository   pushing tip: 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 tried to start a new repository to send again;

$ git init
$ git add .
$ git commit -m 'msg'

New error was reported:

  

In the master branch nothing to submit, empty work directory

How do I upload / update my project on heroku?

Thank you.

    
asked by anonymous 29.04.2015 / 17:09

1 answer

4

The first error indicates that your project is outdated relative to what is in heroku. You have two options. The first is:

git pull --rebase heroku master

And in this case you resolve the rebase to align the branchs. Once this is done, you can push normally.

The second option is the easiest:

git push -f heroku master

The -f means force. In that case you're saying "Heroku, the branch is mine, do what I'm told and you're done." It will simply ignore any conflict, and will adopt your branch as the most current one.

    
29.04.2015 / 18:55