# Suppose you have a feature branch called 'feature-branch' and you want to rebase it onto the 'main' branch.
# 1. Make sure you are on the 'feature-branch'
git checkout feature-branch
# 2. Fetch the latest changes from the 'main' branch
git fetch
# 3. Start the rebase
git rebase main
# During the rebase, you might encounter conflicts if there are changes that conflict with your 'feature-branch'. Git will guide you through resolving these conflicts.
# 4. If conflicts occurred, resolve them, add the resolved files, and continue with the rebase
# Repeat these steps for each conflicting file
git add <file-name>
git rebase --continue
# 5. Once the rebase is complete, push the rebased branch to remote (if it was already pushed before)
git push origin feature-branch --force