How can I accept all current changes in VSCode at once?

GitVisual Studio-Code

Git Problem Overview


I merged a file with one another, but there are bunch of HEADs with Accept Current Change | Accept Incoming Change | ...

Is there a way to accept current changes at once?

Git Solutions


Solution 1 - Git

Its very easy just go to vs code and press Ctrl+shift+p (command palette) or go to view and open command palette manually and type "merge" in your command palette, now you can see the Accept all current changes.

you can see image here

Solution 2 - Git

select the list of files to resolve from the MERGE-CHANGES section, then right-click your mouse and select Accept all incoming. That should do the trick for all files.

Select list of files

Right click and choose Accept all incoming

Solution 3 - Git

Select target file, right click and choose 'Accept All Incoming'.

Screenshot of described step.

Solution 4 - Git

As For VSCode MacOS, I've done Accept All Incoming from Merge Changes section, but it didn't affect all (that may be a bug, or I don't know why). So, I used the conventional way with command line, and it worked.
For accepting all incoming changes,

git checkout --theirs .

or
For accepting all current changes,

git checkout --ours .

P.S. Hope it helps for those who need to solve merging conflict first in any case.

Solution 5 - Git

  1. Select all files in Merge Changes section.
  2. Choose Open File from right click menu. It opens all files.
  3. Select all files again.
  4. Choose appropriate menu from right click. eg. Accept All Current.
  5. Choose Save All from File menu.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJillAndMeView Question on Stackoverflow
Solution 1 - Gitsaurabh SinghView Answer on Stackoverflow
Solution 2 - GitYaki KleinView Answer on Stackoverflow
Solution 3 - GitkomoLeiView Answer on Stackoverflow
Solution 4 - GitFelix HtooView Answer on Stackoverflow
Solution 5 - GitAhmadYoView Answer on Stackoverflow