64 ms·
Proper use of merge is table stakes. You get warned in your PR if your non-main branch is out of date with your main branch, and after you rebase and force push
by benatkin 4y ago
Proper use of merge is table stakes. You get warned in your PR if your non-main branch is out of date with your main branch, and after you rebase and force push your non-main branch, you review the diff in the PR.
- couchand 4y agoThen you don't actually need merge? Am I missing something? If you always rebase the branch, the commits can be applied directly.
- xxpor 4y agoif you do this: (starting on main) git checkout -b feature do work git commit -a git checkout main git pull git checkout feature git rebase main publish code review, get approval git checkout main git merge feature You still use merge at the end, even though it's not actually doing anything that'll result in a conflict.
- couchand 4y agoTotally on board (except the forbidden -a switch). The last command is: cp .git/refs/heads/feature .git/refs/heads/main No merge needed.
- micw 4y agoRather than switching to "main" and pull it, you can just stay in "feature" and do a fetch followed by "rebase origin/main". Then pull "main" before you merge the feature. I'd also use "merge --no-ff" to force an empty commit that visualizes where a feature begins and ends.
- benatkin 4y agoYou're missing the merge commits. `git log` is a key feature and merges belong there, at least in my workflow.