How to fix commit order in GitHub pull requests, broken by git rebase?

To automate what Eliad suggested I use a script from Piotr:

git rebase "$(git merge-base HEAD master)" --ignore-date -x 'git commit --amend -C HEAD --date="$(date -R)" && sleep 1.05'


I've managed to work around this by:

  1. Locate the last commit that retained the order
  2. Run git rebase -i <hash of that commit>
  3. Replace all pick with reword
  4. Run git push -f

Before that, I tried changing only the first commit message, which also changes all the following hashes, but that didn't fix it.

I had to do it for every following commit too for it to work.

Tags:

Git

Rebase

Github