Assume the following graph:
A -- B -- C -- D -- E -- F
\
G -- H -- I
I would like to find G
in order to be able to an interactive rebase to squash the commits (but still keep one commit on the topic branch) which will be reviewed and merged later. I don't want to just rebase the whole branch, because I want to keep the information that there was a branch and it was merged.
(I know that I can look at the history and just use the SHA checksum of the commit, but I'm looking for a way to do it without manually digging up the information or counting how many commits were made and use ~ from HEAD with that number).
Edit: clarification of what I want to achieve:
I want to avoid this:
A -- B -- C -- D -- E -- F -- J
\ /
G -- H -- I -- -- -- -
And have something like this instead:
A -- B -- C -- D -- E -- F -- J
\ /
G' -- -- -- -- -- -- -
In other words, I want to squash the commits with an interactive rebase on the topic branch into one, but still keep the branch and use a regular merge to integrate the changes from the topic branch into the master.