DEV Community

Discussion on: Keep your Git history clean - 101

Collapse
 
rubberduck profile image
Christopher McClellan

Something I’d love to see edited into this is you can specify any commitish when interactively rebasing. When I’m squashing I almost always use git rebase -i origin/master. This way, you automatically get the right number of commits.

Collapse
 
absinthetized profile image
Matteo Nunziati

I declare the rebase point only if it has not been pushed yet. E.g. when I rebase only the last half of my local commits. Otherwise I keep it implicit.

Collapse
 
manuelsidler profile image
Manuel Sidler

Hi Christopher

That's a good point. But careful if your branch doesn't originate from master :-)

Collapse
 
rubberduck profile image
Christopher McClellan

Fair point. I’ve been practicing trunk based development for quite some time now.