Branch from main
Rebase upstream often to avoid conflicts
In case of multiple commits rebase interactively
Commit with the perfect commit message
Rebase from main
Force push your branch
View a list of new commits. View changed files. Merge branch into main.
git checkout main
git pull
git checkout -b <branch-name>
git fetch origin
git rebase origin/main
git rebase -i origin/main
git fetch origin
git rebase -i origin/main
git push --force-with-lease origin <branch-name>
git log origin/main..<branch-name>
git diff --stat origin/main
git checkout main
git merge <branch-name> --ff-only
git push