Working together

Resolving conflicts

A conflict happens when two branches change the same lines differently. Git can't guess which is right, so you decide. Lumbung marks such MRs with Conflicts with the target branch and disables the Merge button.

Resolving conflicts on your computer

git fetch origin
git switch feature/branch-name
git merge origin/main

Git lists the conflicting files. Open each one โ€” the clashing parts are marked:

<<<<<<< HEAD
price = 15_000          โ† your branch
=======
price = 17_500          โ† main
>>>>>>> origin/main

Delete the <<<<<<<, =======, >>>>>>> markers, keep the correct code (a mix of both is fine), then:

git add fixed-file.rb
git commit
git push

The MR is rechecked automatically โ€” once clean, Merge is enabled again.

Alternative: rebase

Straighter history, but it rewrites commits so it needs a force push (only on your own branch, never a protected one):

git fetch origin
git rebase origin/main
# fix conflicts โ†’ git add โ€ฆ โ†’ git rebase --continue
git push --force-with-lease

Preventing conflicts

  • Pull main into your branch often (git pull / git merge origin/main).
  • Keep MRs small and merge them quickly โ€” big MRs living for weeks almost always conflict.
  • Coordinate through issues or a Rembug topic when two people work on the same files.

Giving up halfway

git merge --abort    # or: git rebase --abort