Accept Incoming Change not appearing in VS Code

Viewed 73784

I am trying to resolve merge conflicts into a branch using vs code. However the command palette to accept incoming changes is not appearing

enter image description here

Unlike here where the command palette is clearly visible at the top window.

How do I get those commands to appear at top of window?

14 Answers

Update (August 2022 - version 1.71):

Disabled old conflict decorators, caused by automatically enabled git merge editor is no longer an issue. With the new release the merge editor and the old inline experience can now be used together.

You can also easily switch between the two with a single click.
Check Release Notes - Merge editor improvements to see how.

Minor bug: Button allowing to switch to merge editor from file view is missing if VS Code is connected to WSL. Will update if it gets fixed.

If you still can't see "Accept Change(s)" after updating VS Code, refer to answer by Bruno Monteiro.

Legacy (July 2022 - version 1.70):

You may not also be able to see "Accept Change(s)" because recently VS Code introduced Git merge editor, which is now enabled by default.

It allows you to view and resolve merge conflicts by clicking on a conflicting file in the Source Control view instead. You can turn it off to go back to "Accept Change(s)", though I think it's better.

Add this line to VS Code user settings.json to turn merge editor off: "git.mergeEditor": false

I'm attaching screenshots for anyone want to compare merge.editor off & on:
Git merge editor - off
Git merge editor - on

NOTE:

If you like the new merge editor, you can bring it up from the terminal. Add the following to your .gitconfig, and then run - git mergetool

[merge]
    tool = vscode
[mergetool "vscode"]
    cmd = code --wait --merge $REMOTE $LOCAL $BASE $MERGED
[mergetool]
    keepBackup = false

What resolved this for me was to disable Git Merge Editor. You can find this in File > Preferences > Settings and then search for Git Merge Editor. After unticking the box, you should restart VS Code.

enter image description here

In my case I had a different issue, my "Code Lens" was disabled.

You can go to Settings and search for "codeLens" to make sure it is enabled.

I suppose you're looking for this toolbar:

VS Code merge conflict toolbar

(Image from this Microsoft Repo)

This toolbar only appears when:

  1. there are any merge conflicts and
  2. the current file is in the "MERGE" section of VS Code's version control panel

From what I see in your screenshot, there is indeed a file in the "MERGE" section. I can't really tell whether that is also the file you've opened (Address.js).

Address.js seems to have no conflict markers. In git, conflict markers look like this:

<<<<<<< HEAD
    ...
=======
    ...
>>>>>>> master

In your case it seems like the change was merged by git automatically, without conflicts, which means the toolbar you're looking for won't show here.

In VScode settings (cmd + P , json settings) set:

  "editor.codeLens": true,

Mine was set to false and the commit actions weren't showing up.

Taken from the links in @Teresa Kozeras answer.

Set to True: enter image description here

Set to False: enter image description here

This isn't exactly the question OP asked, but it's the one I was having when google brought me here.

I hope this help somebody. If the Accept Current Changes and stuff does not appear when git rebasing.

enter image description here

Just cut the greater than >>>>>>>> [Commit message] and paste it in any lines after the equal ======= signs and within those signs are the codes for Accept Incoming Changes.

enter image description hereTry to change "git.mergeEditor": false in your VS code settings.

This just happened to me too, the solution for me was to open settings (command+comma), search for merge, and disable Git: Merge Editor. enter image description here

Below is the most simple, easy and fast way for all:

Disable Git Merge Editor.

  1. Go to File > Preferences > Settings in VS code enter image description here
  2. Search for Git: Merge Editor. enter image description here
  3. Untick the check box and restart Vs Code

Enjoy!!!!!!!!!!!!!!!!

First, as I found out, there are two types of related views, a diff/compare view (red/green lines) and a conflict (azure lines as seen in you gif) view.

IF you have a merge conflict, the file in the sidebar will be put under "MERGE CHANGES", and you can click it and it opens like a regular file (just the filename in the tab and nothing else).

However, I had a problem of not seeing any conflict highlighting or toolbar to accept or revert changes, until I figured that it doesn't scroll to the conflict automatically (I had a 40k lines file), and the only way you can spot conflicts as far as I can see, is in the scrollbar with small azure colorings. Then when you scroll to them, the conflict and related actions appear. That's on VS Code, I think, to implement such changes (auto scroll to first conflict, as well as separate buttons to go to next/previous conflict). There are keybind options, though.

Cheers

I had the same problem after having some strange update issue with vscode. I just had to uninstall and install the latest(1.27.1 at the time of writing) version of vscode and it worked again.

I had the same issue and I struggled for hours and nothing worked then the problem solved just by restarting the vs code

Related