Re:The Theatre of Pull Requests and Code Review
by hypeatei on Thursday September 25, 2025 @11:31AM
(#45373991)
...is your friend if you want to leave all your changes unstaged for awhile then break it out into multiple commits later.
[ Parent
| on HN ]
Re:The Theatre of Pull Requests and Code Review
by t-writescode on Thursday September 25, 2025 @11:35AM
(#45374069)
To add, when I’m breaking my changes down into multiple parts for review, I tend to:
* squash everything I’ve done into one commit
* create a new branch off main/master that will be the “first commit”
* cherry-pick changes (easy from some git guis) that represent a modular change.
* push and make an MR from the new branch
* rebase “the big commit” on top of the partial change.
* wash, rinse and repeat for each change, building each MR off its requisite branch.
The squashing part is vital because otherwise you enter merge conflict hell with the rebase.
Re:The Theatre of Pull Requests and Code Review
by m000 on Thursday September 25, 2025 @07:33PM
(#45380687)
How about:
* squash into one commit
* git reset HEAD~1
* git add -p
* git commit -m commit1
* repeat until no changes are left
* add any file deletions/additions
I use this because you can have several commits marked e.g. "commit1". Then you make a final interactive rebase to squash them together.