Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Apr 2021 13:16:45 +0100
From:      Steve O'Hara-Smith <steve@sohara.org>
To:        Andrea Venturoli <ml@netfence.it>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Maintaining my own branch with git
Message-ID:  <20210429131645.818bf135a9c3ebd40c2d50fd@sohara.org>
In-Reply-To: <0e56b430-aac9-ab43-8a3a-7787930fcc31@netfence.it>
References:  <d09f4bef-cbf2-3381-b120-ee62f0fb8b53@netfence.it> <20210428131629.b644748817de331dbe2edef6@sohara.org> <0e56b430-aac9-ab43-8a3a-7787930fcc31@netfence.it>

next in thread | previous in thread | raw e-mail | index | archive | help

On Thu, 29 Apr 2021 14:10:55 +0200
Andrea Venturoli <ml@netfence.it> wrote:

> On 4/28/21 2:16 PM, Steve O'Hara-Smith wrote:
> 
> > 6: Update myworkingbranch with:
> >     git rebase main
> >     NB: This will stash your changes, bring in the updates and then
> > reapply your changes, requiring you to sort out any conflicts that come
> > up. 7: After this rebase you will need to force push myworkingbranch to
> >     your server
> 
> When I try this, I get:
> > % git push
> > To ssh://...
> >  ! [rejected]                  netfence_main -> netfence_main
> > (non-fast-forward) error: failed to push some refs to 'ssh://...'
> > 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.
> 
> Should I pull or push with "-f"?

	Yes you should. What is happening is that when you rebase against
main you rewrite the history of your changes (they are based against a
different commit to those on your server) so you have to use force to get
the server to accept the rewrite of history.

-- 
Steve O'Hara-Smith                          |   Directable Mirror Arrays
C:\>WIN                                     | A better way to focus the sun
The computer obeys and wins.                |    licences available see
You lose and Bill collects.                 |    http://www.sohara.org/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20210429131645.818bf135a9c3ebd40c2d50fd>