Your history is full of "Merge branch 'main' into feature" noise from `git pull`.
BeginnerScenarioRebase, Cherry-pick and History Rewriting
Answer
Situation read → Plain git pull merges upstream into your local commits, creating a merge commit each time.
What I'd do →
git config --global pull.rebase truemakes pull replay your commits on top.- Or
git config --global pull.ff onlyto refuse non-fast-forward pulls and decide consciously. - Fix an existing branch with
git rebase origin/main.
Why → Rebase keeps local work on top of upstream, giving a linear branch.
Interview tip → Newer Git warns until you set pull.rebase, so setting it is part of a good global config.
More on Rebase, Cherry-pick and History Rewriting
Your PR branch has ten commits like "wip", "fix typo", "oops". How do you clean it up before review?BeginnerYou want the database migration commit to come before the code that uses it.BeginnerA critical fix on `main` must go to the `release/4.1` branch only.BeginnerYou must backport a feature made of 6 commits, including one merge commit.IntermediateBranch B was built on top of branch A. A was squash-merged into `main`, and now B shows A's commits again.IntermediateDuring review you get ten small change requests on old commits. How do you apply them cleanly?Intermediate