How can I accept all current changes in VSCode at once?
GitVisual Studio-CodeGit 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.
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.
Solution 3 - Git
Select target file, right click and choose 'Accept All Incoming'.
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
- Select all files in
Merge Changes
section. - Choose
Open File
from right click menu. It opens all files. - Select all files again.
- Choose appropriate menu from right click. eg.
Accept All Current
. - Choose
Save All
fromFile
menu.