[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master bdda935 2/2: Merge branch 'master' of git.savannah.gnu.org:/s

From: Stefan Monnier
Subject: Re: master bdda935 2/2: Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Date: Mon, 17 Aug 2020 16:31:52 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>>>> Doesn't Git offer some way to *merge* (not rebase) but with the branches 
>>>> swapped?
>>> A merge always uses HEAD as the first parent, so if you want to swap,
>>> swap HEAD.
>> How can I do that in a way that as seamless as `git merge`?
> You just need to make sure HEAD points to the commit you want as the
> first parent.

No, I want the following:

- I'm in a Git worktree with HEAD pointing at some local change of mine.
- I do `git ..magical..merge..`
- Now I'm in a worktree where HEAD was merged with the upstream branch
  and the upstream branch (rather than HEAD) is the first branch.

Technically within Git it's a small matter of the order in which the
parents are listed in the commit.  The question is how to get Git to do
it using the available command line API.

I know several ways to do that, but none of them are as seamless as `git
merge` w.r.t things like execution time, treatment of non-committed changes,
or the set of files whose mtime is affected.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]