Skip to main content
A merge conflict happens when Git can’t combine two sets of changes by itself, for example when your branch and your default branch change the same lines of a file. You fix it on your branch in the Code IDE, and the merge goes to the remote with your next push.
Prerequisites
  • A project open in the Code IDE, with Git Lite turned on. For Git Advanced, see Resolve conflicts in Git Advanced.
  • Changes that conflict with the remote. Git Lite finds conflicts when it pulls: when you click Update branch, click Pull N changes in the Explorer, or switch to a branch that changed on the remote.
Estimated time: 10 minutes.
If your Git provider says your pull request has conflicts, click Update branch in Git Lite. Git Lite pulls your default branch into your branch, and you resolve the conflicts with the steps below.

Steps

1

Find the conflicted files

When a pull finds conflicts, Git Lite stops before it pushes, and a notification shows the message from Git. Open the Git Lite panel if it isn’t open already.In the Changes list, each conflicted file shows a warning triangle instead of a status letter. The panel asks you to resolve the merge conflicts before committing, and Ship it and Commit & Push stay off until you do.
2

Resolve each conflict

Click a conflicted file to open it. The editor marks each conflict and shows these actions above it:
  • Accept Current Change: keep the version from your branch.
  • Accept Incoming Change: take the version you pulled.
  • Accept Both Changes: keep both versions, one after the other.
  • Compare Changes: open the two versions side by side.
You can also edit the lines yourself. Remove the conflict markers (<<<<<<<, =======, and >>>>>>>) when you’re done.
3

Save the files

Save each file. Git Lite checks your files again every time you save. When no conflicts are left, the warning goes away, and Ship it and Commit & Push turn back on.
4

Commit the merge

Write a commit message, for example Merge main into feat/orders-mart, or click Write commit. Keep every file selected, because the list also holds the files that Git merged without conflicts.Click Ship it to commit, push, and open the pull request page. If you don’t want to open a pull request yet, click the arrow next to Ship it, then Commit & Push.
You’ll know it worked when the conflicted files are gone from the Changes list and the sync status shows Up to date on origin. If the conflict warning stays after you save, a conflict marker is still in one of the files, or a changed line ends with a space. See Troubleshooting.

Abort the merge

If you’re not ready to resolve the conflicts, click Abort merge at the top of the Changes list. Git Lite cancels the merge and puts your branch back the way it was before the pull. You can update the branch again later.

Resolve conflicts in Git Advanced

In Git Advanced, conflicted files show in the Merge Changes group of the Source Control view. Resolve them in the editor with the same actions, save them, stage them, and commit.

Troubleshooting

  • The conflict warning stays after you remove every conflict marker. Git Lite’s check also flags spaces at the end of the lines that changed. Remove them and save again.
  • Discard all changes is missing. Git Lite hides it during a merge. Use Abort merge instead.

Next steps

Use Git Lite

Ship changes and keep your branch up to date.

Delete branches

Prune your local branches after their pull requests merge.

Use Git Advanced

Stage, amend, and manage branches with full control.

Git Lite reference

Every control in the Git Lite panel.