Home > Net >  Can't accept/deny individual changes with git merge anymore, can only accent/deny all changes a
Can't accept/deny individual changes with git merge anymore, can only accent/deny all changes a

Time:08-11

When attempting to merge my main branch into my current branch earlier today (I misclicked a change I didn't want to keep so needed to restart the process), and also when merging in previous projects, I've been able to open each file, view every single change individually, and accept or deny them one-by-one. All of a sudden those options are gone, and I can only accept or deny all changes at once in the source control tab itself. Weirdly enough, I'm still seeing this text around each of my differences without any option to click accept/deny on any of them:

<<<<<<< HEAD
...some changes here
=======
...old code here
>>>>>>> main

Naturally since <<<<<<< HEAD, =======, and >>>>>>> main aren't actually code, I'm getting syntax errors via VS Code automatically adding them around each change during my attempted merge. What I'm confused about is why it's suddenly treating these additions as actual text/additions to my code, rather than the temporary merge UI I was able to use before (with accept or deny buttons directly above each change). There are also no more green or red highlights around these sections showing the merge differences at all.

Rather than accept/deny them individually in each file normally, I was able to use the source control tab of VS Code itself to manage the merge at least somewhat, but it appears that the only options in each file are to accept or deny ALL changes at once, and I cannot verify each change individually. I've attempted to reinstall VS Code and re-cloned my repo and branch as well.

Does anyone have any idea what caused this, or any way to fix it?

Edit: I have verified that the issue involves the "Code Lens" setting in user preferences, however changing its value (or any similar ones) doesn't seem to do anything

CodePudding user response:

Solved the issue. Apparently VS Code forces its new "Git: Merge Editor" setting to be enabled by default. Even if you have your corresponding "Code Lens" settings enabled, they will be overridden if you have "Git: Merge Editor" enabled. Disabling that did the trick.

  • Related