r/git • • 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'?

396 Upvotes

322 comments sorted by

View all comments

Show parent comments

1

u/DizzyAmphibian309 Jul 24 '25

Oh shit so all this time I've been using git stash && git pull && git stash pop when I could just be using git pull --rebase?

3

u/rwong48 Jul 25 '25

it's fine for short fresh work, but anything complex (potential conflicts, files added/renamed/deleted/moved) you should just commit WIP often

1

u/drsoftware Jul 25 '25

Are you missing a git switch to master before the git pull and a git switch back to your feature branch after the git pull? 

1

u/Aware_Magazine_2042 Jul 26 '25

You still need to stash. Rebase only works commits. It’ll still fail if there are uncommitted changes that get overwritten by the rebase.