Having pulled a 2nd git repo into another locally with conflicts, I want to be able to call git mergetool from within Powershell to always choose (m)odified for each file. I don't want to be prompted for manual input for each file separately.

I always want the modified version regardless of whether it comes from 'ours' or 'theirs'

I tried Echo m | git mergetool but this only seems to input a value for the first conflicted file.

Deleted merge conflict for '-------------': {local}: deleted {remote}: modified file Use (m)odified or (d)eleted file, or (a)bort?

My Powershell knowledge is limited but is there a way of achieving this?

1

There are 1 best solutions below

0
LeGEC On

For paths that have a delete/modified conflict, no need to invoke mergetool, you can :

git reset <file>
git add <file>

To spot these files :

git status -s | grep "^DU"
git status -s | grep "^UD"

# or using powershell built-ins :
git status -s | sls "^DU"
git status -s | sls "^UD"