Reputation: 4483
I am trying to resolve merge conflicts into a branch using vs code. However the command palette to accept incoming changes is not appearing
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
Reputation: 1730
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.
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
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
Reputation: 663
Try to change "git.mergeEditor": false
in your VS code settings.
Upvotes: 7
Reputation: 894
Below is the most simple, easy and fast way for all:
Disable Git Merge Editor.
Enjoy!!!!!!!!!!!!!!!!
Upvotes: 6
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.
Upvotes: 6
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.
Upvotes: 71
Reputation: 949
In case someone still can't solve this issue.
You can turn off the Git: Merge Editor
from Setting
menu.
VSCode merge conflict options not displaying
Upvotes: 28
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
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.
This isn't exactly the question OP asked, but it's the one I was having when google brought me here.
Upvotes: 21
Reputation: 232
For me disabling GitLens helped: https://github.com/eamodio/vscode-gitlens/issues/319 https://github.com/eamodio/vscode-gitlens/issues/344
Upvotes: 6
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
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
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
Reputation: 492
I hope this help somebody. If the Accept Current Changes and stuff does not appear when git rebasing.
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
Reputation: 9897
I suppose you're looking for this toolbar:
(Image from this Microsoft Repo)
This toolbar only appears when:
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