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:
- Locate the last commit that retained the order
- Run
git rebase -i <hash of that commit>
- Replace all
pick
withreword
- 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.