How to resolve conflicts when merging and updating files in git?

I feel like I'm getting closer to all of this.

I work as part of a team and we use git. Now, when I pull updates from my team, conflicts arise from time to time - git seems to insert a lot of texts into files that are not good.

In any case, is there a decent way to manage these conflicts (I am in the windows).

I used winmerge, but from what I see, it can only compare 2 directories. This makes conflict conflict easy, but requires that I have 2 source conditions in two different places.

Does anyone know a better way to do this or how to integrate the two?

+5
source share
2

mergetool Git, . , . : Beyond Compare, SO, .

script, , .

, , , , Beyond Compare Linux:

git config --global merge.conflictstyle=diff3
git config --global merge.tool=bc3
git config --global mergetool.bc3.cmd=/usr/bin/bcompare $LOCAL $REMOTE $BASE $MERGED
git config --global mergetool.bc3.trustexitcode=true

, Git .

+5

, :

Git Windows: mergetool?

p4merge () ( , , " -):

C:\Program Files\Git\cmd, git-merge.sh, :

#!/bin/sh

# Passing the following parameters to mergetool:
#  local base remote merge_result

base=$1
alocal=$2
remote=$3
result=$4

if [ -f $base ]
then
    p4merge.exe -dl "$base" "$alocal" "$remote" "$result" 
else
    p4merge.exe -dl "$result" "$alocal" "$remote" "$result" 
fi

C:\Documents and Settings\me my .gitconfig :

[merge]    
    keepBackup = false
    tool = p4merge
[mergetool "p4merge"]
    cmd = \"c:/Program Files/Perforce/p4merge.exe\" \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
    keepTemporaries = false
    trustExitCode = false
    keepBackup = false
    path = C:/Program Files/Perforce/p4merge.exe
[mergetool]
    keepBackup = false
0

All Articles