Hacker News new | ask | show | jobs
by doix 1041 days ago
Is that really an issue? When you rebase, git automatically figures out that you've cherry-picked something and will skip it.

I will occasionally chery-pick something from master, do my work etc. Before making my PR, I'll rebase against master and potentially squash/reorganize my commits. When the PR eventually gets merged to master there aren't any problems.

I don't think I ever merge without rebasing though, so maybe rebase has been saving me from any potential problems.

1 comments

Yeah I very rarely rebase, just autosquash PR commits into one on merge to master (and also delete the source branch to avoid similar headaches) + making sure PRs are fairly small and focused. Regular merges where commits have been cherry picked from one side to another, and then later also unmerged changes have touched those same files tend to result in a lot of spurious merge conflicts.