DEV Community

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

Collapse
 
aahnik profile image
Aahnik Daw

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.

Collapse
 
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...

Collapse
 
aahnik profile image
Aahnik Daw

thanks a lot