RyeGuy
RyeGuy

Reputation: 4483

Accept Incoming Change not appearing in VS Code

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?

Upvotes: 114

Views: 121201

Answers (14)

13ibrahimov
13ibrahimov

Reputation: 1730

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.

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

Upvotes: 161

Buwaneka Sumanasekara
Buwaneka Sumanasekara

Reputation: 663

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

Upvotes: 7

V_for_Vj
V_for_Vj

Reputation: 894

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!!!!!!!!!!!!!!!!

Upvotes: 6

Nikhith sunil
Nikhith sunil

Reputation: 285

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

Upvotes: 6

anosha_rehan
anosha_rehan

Reputation: 1600

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

Upvotes: 71

Ganda Rain Panjaitan
Ganda Rain Panjaitan

Reputation: 949

In case someone still can't solve this issue. You can turn off the Git: Merge Editor from Setting menu.

enter image description here

VSCode merge conflict options not displaying

Upvotes: 28

shabeer ghafoori
shabeer ghafoori

Reputation: 1

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

Upvotes: 0

sirclesam
sirclesam

Reputation: 2347

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.

Upvotes: 21

emboel
emboel

Reputation: 169

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

Upvotes: 4

Bruno Monteiro
Bruno Monteiro

Reputation: 4519

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.

Upvotes: 58

Gásten
Gásten

Reputation: 133

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.

Upvotes: 1

Quer
Quer

Reputation: 492

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.

Upvotes: 6

Fabian Lauer
Fabian Lauer

Reputation: 9897

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.

Upvotes: 21

Related Questions