To what is the error (non-fast-forward) failed to push some refs

1
  

To link ! [rejected]
  gh-pages - > gh-pages (non-fast-forward) error: failed to push some   refs to ' link ' hint: Updates   were rejected because the tip of your current branch is behind hint:   its remote counterpart. Integrate the remote changes (e.g. hint: 'git   pull ... ') before pushing again. hint: See the 'Note about   fast-forwards' in 'git push --help' for details.

I'm trying to upload the gh-pages branch and it tells me this, I tried to download the changes from the remote repository and I have not yet been able to solve it, the problem is when I get this interface that I do not know how to add the commit and how to get out of here

Not what is presented at the moment is a sample image, what I could do was erase this branch from the remote repository, but I would like to know how to get out of this interface

    
asked by Juan David 26.04.2016 в 18:35
source

1 answer

2

Your branch is behind the remote branch, to solve it you must first pull to update your local branch to the last commit of the remote branch.

git pull

When the interface (of the image) appears, load the message of the commit (you can leave the one that comes by default) and then press the sequence ESC : w q enter (which means Save and exit in the vi editor that appears in the image)

This will end the pull if there are no conflicts.

Finally you can do the:

git push origin gh-pages
    
answered by 26.04.2016 / 18:56
source