For commits in the same branch
This is important: you need to give a reference to commit to the one you want to pass through. Here we make the "before" link with ^ .
An editor window will open. This is probably vim, and if you are not familiar with it, check out How to exit the Vim editor?
In this list, commits go in reverse order (not like in git log ): from earliest to last.
Align the lines as follows:
pick d294fac commit 1 squash f68ffb5 commit 6 pick <sha1> commit 2 pick <sha1> commit 3 pick <sha1> commit 4 pick <sha1> commit 5
Save the document. Git now opens a new editor window to report the new commit 1 & 6. Save it too. The permutation is in progress.
source share