3

'git pull --rebase' a day
Keeps the merge conflicts away

Comments
  • 0
    does it really though?
    I've rebased and still dealt with merge conflicts
  • 1
    @iSwimInTheC it is helpful if you have already committed code, and then a pull gets you into merge.
  • 0
    That either means you work on the same branch with multiple people or directly on master.

    Within feature branches, I'd say a

    git rebase origin/master

    keeps the merge conflicts manageable.

    For git pull, I have it in my config that it defaults to git pull --rebase to avoid unnecessary merge commits of a branch.
  • 0
    git config --global pull.rebase true
  • 0
    @iSwimInTheC it depends how soon you rebase. I had long running feature branch (6 months) and every few days I rebased against the main branch. So I always had tiny conflicts I could easily resolve instead of a huge mess in the end. That way, the branches didn't diverge and also the history of my branch was clean as it was not messed up with loads of merge commits.
Add Comment