Discussion on: How to change the commit history in GitHub?

aahnik profile image
Aahnik Daw Author

I got a solution on stack overflow ... Thanks to Shridhar R Kulkarni

git push -f will solve the problem of divergent branches.

After git rebase -i , using -f flag with push will change the commit history in GitHub commits page as desired.

kallmanation profile image
Nathan Kallman

Instead of just -f consider the slightly better --force-with-lease.

It can save you from accidentally overwriting changes you didn't know had been pushed to the branch: thoughtbot.com/blog/git-push-force...