"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

Stefan Sperling <stsp@stsp.name>
Re: Remote has rebased, now what?
Christian Weisgerber <naddy@mips.inka.de>
Wed, 1 Mar 2023 17:06:34 +0100

Download raw body.

On Wed, Mar 01, 2023 at 04:54:25PM +0100, Christian Weisgerber wrote:
> Thomas Adam:
> > Please have a look at the `ta/configh` branch in the main -portable repo,
> This leads me to a usage question:
> Thomas has just rebased the ta/configh branch after he had already
> published it.  Oh-oh.  Now, after the latest "got fetch" I have a
> origin/ta/configh branch and a divergent ta/configh branch that I
> can no longer cleanly rebase on origin.  Conflicts!  What's the
> recommended way to get them back in sync?
> (I ended up using histedit -d to cut off enough of the tip of
> ta/configh that I could rebase>forward it again on origin/ta/configh.)

There is no magic bullet.

You could rename your existing ta/configh branch:

  got branch -c ta/configh ta/configh-old
  got branch -d ta/config-h

ANd create a new ta/configh branch which corresponds to the latest state:

  got branch -c origin/ta/configh ta/configh

And then cherrypick relevant commits from ta/configh-old which you
want to put on top of the new version of this history.

In the got.git repo branches other than main have so far only been
used by one developer at a time, in cases where they wanted to keep
a backup of their work while allowing others to see it.

I would recommend mailing diffs which target the main branch instead
of collaborating on branches that are subject to rebasing.