3

I want to do the below:

  1. select the next conflict (like an F8 will be great)

  2. choose local or server (l or s or both)

  3. move to next conflict. (again by pressing F8)

Ziaullah Khan
  • 2,020
  • 17
  • 20

2 Answers2

3

I know its late answer, but I would like to share How I manage to merge issues in Visual studio. I am using Visual Studio 2017, Source Tree and Visual Studio code.

How to Use VsCode for merging conflicts in Source Tree.

Merge conflict view in VsCode

How to Use VsCode for merging conflicts in Source Tree.

In source tree under Diff, choose custom.

Source Tree Settings Diff Tab

For Diff

Diff Command: C:/Program Files/Microsoft VS Code/Code.exe

Arguments: --diff --wait "$LOCAL" "$REMOTE"

For Merge

Merge command: C:/Program Files/Microsoft VS Code/Code.exe

Arguments: -n --wait "$MERGED"

Make sure your paths are set correctly. I am not sure how to assign, shortcuts to move between conflicts.

fizmhd
  • 526
  • 3
  • 10
  • 31
0

Install AutoHotkey.

Run Window Spy.ahk and find X and Y positions for both Server and Local checkboxes, write them down and replace them in the code.

Save the code below with .ahk extension.

This code doesn't select the next conflict, but you can do that with Enter.

#NoEnv
SetWorkingDir %A_ScriptDir%
#Warn
CoordMode, Mouse, Window
SendMode Input
#SingleInstance Force
SetTitleMatchMode 2
SetTitleMatchMode Fast
DetectHiddenWindows Off
DetectHiddenText On
#WinActivateForce
#NoTrayIcon
SetControlDelay 1
SetWinDelay 0
SetKeyDelay -1
SetMouseDelay -1
SetBatchLines -1


#IfWinActive Microsoft Visual Studio ahk_exe devenv.exe

s::
Server:
x := 90
y := 160
Click, %x%, %y% Left, 1  ; Server
Sleep, 300
Send, {Alt Down}{a}{Alt Up}  ; Accept Merge
Return

l::
Local:
x := 585
y := 160
Click, %x%, %y% Left, 1  ; Local
Sleep, 300
Send, {Alt Down}{a}{Alt Up}  ; Accept Merge
Return

#IfWinActive