I've just merged a PR for my GitHub repository. But - I want to squash the different commits that have gone into that PR. I thought I would be able to do it by simply
rebase -i <hash-of-first-commit-in-the-PR>^
but that doesn't do what I expected - the commits I see in the list in the rebasing editor are not the ones I see in git log
; and, specifically, the commits I want to squash together aren't there.
Looking further back, here is a part of the commit graph:
* hash11 (HEAD -> development, origin/development) Lorem ipsum dolor sit amet
* hash10 Merge pull request #123 from someone/development
|\
| * hash09 Merge branch 'development' into development-fork
| |\
| |/
|/|
* | hash08 consectetur adipiscing elit
* | hash07 sed do eiusmod tempor incididunt
* | hash06 ut labore et dolore magna aliqua
* | hash05 Ut enim ad minim veniam
* | hash04 quis nostrud exercitation ullamco laboris nisi
* | hash03 Merge pull request #101 from someone/development
|\ \
| | * hash02 ut aliquip ex ea commodo consequat.
| |/
| * hash01 Duis aute irure dolor in reprehenderit in voluptate velit esse
|/
* hash00 cillum dolore eu fugiat nulla pariatur.
The PR merge is commit hash10. It brought in two commits by "someone", hash09 and hash02. The meat of what I care about is hash02. Looking at this graph, I realize that my situation is messier than I initially described. Perhaps I should even be trying to squash hash09 into hash02, even though on "someone"'s branch they were simple consecutive commits?
PS - Naturally I don't mind force-pushing into GitHub afterwards.