On Tue, 6 Dec 2016 18:55:28 -0800 (PST)
Charlie Oehlrich wrote:
> it is currently like this
>
> master = A-B-C-D
>
> branch-2 = E-F-G
>
> branch-3 = H-I-J-K
>
> G is both of these commits in the original
> repositry:
> https://github.com/Lunatrius/Schematica/commit/3ee0f93def0c13d021d98815861a77665d31df04
> and
> https://github.com/Lunatrius/Schematica/commit/3ee0f93def0c13d021d98815861a77665d31df04
> (it also says it is a merge commit) with my user name
>
> L is the first commit with the username for the original repositry
>
> M is the second commit with the username for the original repositry
>
> and i want to make it like this:
>
> master = A-B-C-D
>
> branch-2 = E-F-L-M
>
> branch-3 = H-I-J-K
>
> (for what it currently is that is what it looks like on github
> desktop and on the website it has for branch-2 it has E-F-L-M-G also
> for G it has the exact same things as L and M)
I don't think I understand, but if we consider just the present
> master = A-B-C-D
> branch-2 = E-F-G
> branch-3 = H-I-J-K
and the required
> master = A-B-C-D
> branch-2 = E-F-L-M
> branch-3 = H-I-J-K
in isolation, the only thing you want is to have
> branch-2 = E-F-G
replaced with
> branch-2 = E-F-L-M
that is, the commit G on branch-2 replaced with commits L-M.
Now there's one question you need to answer: is there already exists a
line of history in your repository which includes the chain F-L-M?
(It could be reachable from any branch or tag.)
If yes, the only thing you need is to merely reset branch-2 to point
to M. This could be done in multiple ways:
git push -f . M:branch-2
or
git checkout branch-2
git reset --hard M
If no, and the chain of commits L-M does not hang off F, or they are
just two disjoint commits, you will need to first reset branch-2 to F
and then cherry pick L and M:
git checkout branch-2
git reset --hard F
git cherry-pick L M
Note that these won't be exactly L and M -- cherry picking applies
commits as textual patches, and they will be recorded with the new
"committer" and "commit date" values -- changing their SHA-1 hashes,
so your branch will end up looking like ...-F-L'-M' with those L' and M'
representing the same changes as L and M but having different metadata.
--
You received this message because you are subscribed to the Google Groups "Git
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.