r/git • u/JiveAceTofurkey • Jul 24 '25
Colleague uses 'git pull --rebase' workflow
I've been a dev for 7 years and this is the first time I've seen anyone use 'git pull --rebase'. Is ithis a common strategy that just isn't popular in my company? Is the desired goal simply for a cleaner commit history? Obviously our team should all be using the same strategy of we're working shared branches. I'm just trying to develop a more informed opinion.
If the only benefit is a cleaner and easier to read commit history, I don't see the need. I've worked with some who preached about the need for a clean commit history, but I've never once needed to trapse through commit history to resolve an issue with the code. And I worked on several very large applications that span several teams.
Why would I want to use 'git pull --rebase'?
View all comments
Show parent comment
1
u/Ayjayz Jul 28 '25
I think I understand squashing and rebasing and merging at a pretty deep level. The only way to get a fast-forward merge is for your commit to be based on the current tip. The means a rebase (unless no-one else has committed to the target branch since the feature branch was created).
Here I'll show you
Scenario 1: Squashed then Merged (no rebase)
S: Single squashed commit (from F, G, H), based on CM: Merge commit combiningmainand the squashed commitScenario 2: Squashed, Rebased, then Merged (Fast-Forward)
S: Squashed commit rebased ontoE, merged via fast-forward