Heroku: like 'git pull' after 'git push -f'

I received this error message (copied below) after trying to click on Heroku. First, I created an application for facebook canvas and chose hosting on heroku options. This gave me the heroku url that I added as a remote control in the application I was developing on my machine.

heroku git:remote -a desolate-springs-1684 

But when I clicked, I got this error

 error: failed to push some refs to ' git@heroku.com :desolate-springs-1684.git' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (eg 'git pull') before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details. localhost:nhl michaelmitchell$ 

So i did

 git push -f heroku master 

But now I probably have to do a "git pull". However, what did I put after 'git pull'? Hero name url? or something different?

+6
source share
2 answers

Forcing git push not a good idea because you lost any obligation that you or other employees made that you were not in your working copy.

Before clicking, you must either merge or recreate the upstream changes to the local working copy.

To merge changes locally

 $ git pull heroku master $ git push heroku master 

To save changes locally

 $ git pull --rebase heroku master $ git push heroku master 

By the way, now that you have pushed your changes, you actually do not need to do anything. The remote repository already contains all your changes.

If for some reason the $ git status command returns obsolete links, just run

 $ git pull heroku 

to get all deleted changes. Note that if you do not specify a target branch (or you have a tracking branch enabled), git pull will simply load (rather than merge) upstream changes.

Also note that Heroku should not be considered a git host. This means that it is extremely unusual to perform a git pull from Heroku. Instead, you should use git hosting (like GitHub or BitBucket) to store your repository and only push to Heroku to deploy the application.

+18
source

This error basically means that the repo has code that is newer than the code you are trying to click on it.

you need to do a pull and update your own working repository, then click again or just force push

 git pull heroku master 

As a side note, if you are not familiar with all the git commands, I would recommend using a graphical interface, as this can make the whole process much less overwhelming.

There are many great customers here: http://git-scm.com/downloads/guis

+1
source

Source: https://habr.com/ru/post/925363/


All Articles