#Git – How to do a rebase interactive

-Having a main branch called “main” and a working branch called “myproject” where all changes are committed

-We switch to the “main” branch

git checkout main

-We bring all the changes from the “main” branch

git fetch
git pull

-We return to the branch “myproject

git checkout –

-We start the interactive rebase from “main” branch to “myproject” branch

git rebase -i main

—-Here we resolve conflicts (if they exist), squash committees, etc…

-We push the rebase changes to the “myproject” branch

git push –force-with-lease

Tested on: Git 2.36