# Instead of rebasing, etc....?

4 messages from 2010-05-06 to 2010-05-10. Participants: Dave Abrahams, Raja R Harinath, Ramkumar Ramachandra.
Thread: https://gitlist.dev/t/23723

## Dave Abrahams, 2010-05-06 22:42

Subject: Instead of rebasing, etc....?
Message-ID: <loom.20100507T003055-527@post.gmane.org>
URL: https://gitlist.dev/e/loom.20100507T003055-527%40post.gmane.org

```
I often find myself pursuing a development branch that I'm pushing out
to a public repo, and then wanting to go back a few commits and start
the end of the branch anew.

o-o-o-o origin/dev
      \
       o-o-o dev

Of course then I want to push dev and move origin/dev to refer to it.
So I delete and recreate origin/dev.  That's essentially like
rebasing, and all the advice says "don't do it."  How bad is that,
really, if it's my own development branch?

If I try to avoid doing that I guess I have to "merge" with the remote
branch but discard all its changes?

o-o-o-o - - - -o origin/dev dev
       \      / 
        o-o-o 


Is there a shortcut for that?  It would be nice if Git had a way to
note that sort of "false parentage" (the dotted line above)
explicitly; it's not really there logically; it just helps the
workflows to move along smoothly.

```

## Dave Abrahams, 2010-05-06 22:50

Subject: Re: Instead of rebasing, etc....?
Message-ID: <loom.20100507T004928-336@post.gmane.org>
URL: https://gitlist.dev/e/loom.20100507T004928-336%40post.gmane.org
In-Reply-To: <loom.20100507T003055-527@post.gmane.org>

```
Dave Abrahams <dave <at> boostpro.com> writes:

> 
> I often find myself pursuing a development branch ...

Sorry, my ASCII art was messed up in the previous message.  
Here's what I meant:

o-o-o-o origin/dev
   \
    o-o-o dev


o-o-o-o - -o origin/dev dev
   \      / 
    o-o-o 

```

## Raja R Harinath, 2010-05-10 08:03

Subject: Re: Instead of rebasing, etc....?
Message-ID: <87ljbsdvzp.fsf@hariville.hurrynot.org>
URL: https://gitlist.dev/e/87ljbsdvzp.fsf%40hariville.hurrynot.org
In-Reply-To: <loom.20100507T004928-336@post.gmane.org>

```
Hi,

Dave Abrahams <dave@boostpro.com> writes:

> Dave Abrahams <dave <at> boostpro.com> writes:
>
>> I often find myself pursuing a development branch ...
>
> Sorry, my ASCII art was messed up in the previous message.  
> Here's what I meant:
>
> o-o-o-o origin/dev
>    \
>     o-o-o dev
>
>
> o-o-o-o - -o origin/dev dev
>    \      / 
>     o-o-o 

You can use the 'ours' merge strategy.

On the 'dev' branch, you do

   git merge -s ours origin/dev

Now 'origin/dev' is a parent of the new 'dev', while the tree contents
haven't changed.  You can now push 'dev' back to origin without any
hassles.

- Hari

```

## Ramkumar Ramachandra, 2010-05-10 08:49

Subject: Re: Instead of rebasing, etc....?
Message-ID: <AANLkTikikb5rKfxBlqrNfgLQhKRYKZ_e-760vWEMLKQ1@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTikikb5rKfxBlqrNfgLQhKRYKZ_e-760vWEMLKQ1%40mail.gmail.com
In-Reply-To: <loom.20100507T003055-527@post.gmane.org>

```
Hi,

> Of course then I want to push dev and move origin/dev to refer to it.
> So I delete and recreate origin/dev.  That's essentially like
> rebasing, and all the advice says "don't do it."  How bad is that,
> really, if it's my own development branch?

If I understand correctly, you want a non-FF push. Simply develop on
dev and `git push origin +dev:dev` to force a non-FF push. It's not
bad at all if your branch isn't public and others aren't pulling from
it.

-- Ram

```
