feature that is behind main. You run git rebase main while on feature. What happens?Running git rebase main while on feature takes the commits unique to feature and replays them on top of the latest main commits. This updates feature to include all changes from main without a merge commit.
git rebase -i allow you to do?git rebase -i) enables.git rebase -i opens a list of commits allowing you to change their order, combine commits (squash), edit commit messages, or remove commits before replaying them.
git rebase main, Git stops and shows a conflict. What should you do next?When a conflict occurs during rebase, you must manually fix the conflicting files. After fixing, you run git rebase --continue to proceed. Aborting cancels the rebase, and merging is a different operation.
git rebase is NOT recommended.Rebasing rewrites commit history. If you rebase commits that others have already pulled, it can cause confusion and conflicts. It's safer to avoid rebasing shared branches.
feature branch with changes from main using rebase.First, git fetch origin updates remote tracking branches. Then, switch to your feature branch with git checkout feature. Next, rebase your feature branch onto the updated origin/main with git rebase origin/main. Finally, push your rebased branch with git push --force-with-lease to update the remote safely.