[GRASS-dev] git usage question: error: failed to push some refs...

Hi devs,

I am struggling to push my code simplification (thanks for the tip,
Vaclav) to https://github.com/OSGeo/grass/pull/922

Now I get:

git push origin memory_grassrc_setting
To github.com:neteler/grass.git
! [rejected] memory_grassrc_setting ->
memory_grassrc_setting (non-fast-forward)
error: failed to push some refs to 'git@github.com:neteler/grass.git'
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.

What happened, if I recall correctly, is that I edited one thing via
GitHub web interface.
This will be missing from my local repo and hence the push command
throws an error.

What's the trick to sync it? (I RTFM'ed for a while but...)

My remotes are this:

git remote -v
origin git@github.com:neteler/grass.git (fetch)
origin git@github.com:neteler/grass.git (push)
upstream git@github.com:OSGeo/grass.git (fetch)
upstream git@github.com:OSGeo/grass.git (push)

thanks for a pointer,
Markus

Hi,

On Sat, Aug 22, 2020 at 11:58 AM Markus Neteler <neteler@osgeo.org> wrote:

Hi devs,

I am struggling to push my code simplification (thanks for the tip,
Vaclav) to https://github.com/OSGeo/grass/pull/922

Now I get:

git push origin memory_grassrc_setting
To github.com:neteler/grass.git
! [rejected] memory_grassrc_setting ->
memory_grassrc_setting (non-fast-forward)
error: failed to push some refs to 'git@github.com:neteler/grass.git'
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.

What happened, if I recall correctly, is that I edited one thing via
GitHub web interface.
This will be missing from my local repo and hence the push command
throws an error.

Cool, Vero told me the trick (thanks!):

git pull origin memory_grassrc_settings

(here I got an expected conflict which I fixed and committed)

then:
git push origin memory_grassrc_setting

and all successfully updated in PR922.

Markus