git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Query on managing the order of commits in git merge
@ 2021-03-23 18:34 Linu Cherian
  2021-03-23 19:04 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Linu Cherian @ 2021-03-23 18:34 UTC (permalink / raw)
  To: git; +Cc: Linu Cherian

Hi,

Had a query related to the order of commits in the command, git merge.

Lets say, we have a local branch(say A) tracking a remote upstream branch,.

A has the following commits,
A ---> 1---2---3--4

We do have another branch B, which is forked out of A and our
features/fixes has been added
on top of A.
B ---->1 --2--3--4--5--6


At a later stage, we sync branch A to the remote upstream branch
and it becomes,
A --> 1--2--3--4--7--8

Now, when we merge A to B, the order in which the commits are merged
into can be different based on date of commit. CMIIW

Like, case 1:

B --> 1--2--3--4--5--6--7--8--M

case 2:

B-->1--2--3--4--7--8--5--6--M

where M is the merge commit.

The query is, do we have control over in what order the patches gets
merged into B.
To be specific, is it possible to ensure that the local changes 5 & 6
is always on top of A,
without affecting the commit ids(ie. case 2 above).

We are not considering the option of git rebase, since it alters the commit ids.
Appreciate your thoughts on this.

Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-23 19:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-23 18:34 Query on managing the order of commits in git merge Linu Cherian
2021-03-23 19:04 ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).