, 나는 정말 멋진 병합 도구입니다 KDiff3을 추천 할 수 있습니다 :
는이 스크립트를 사용하여 중복 행을 포함하지 않으려면. 귀하의 경우,
kdiff3 -o output.txt m1 m2
를 실행하고 각각에 대해
이 (또는 둘 다) 선택할 수있는 라인을 선택하는 충돌을 눌러 A 또는 B 버튼을 병합 얻을 것이다. 하단 영역에서 원하는대로 편집 할 수 있습니다.
업데이트 : 터미널에서 텍스트 모드로 작업하려면 임시 저장소를 설정하는 것이 좋습니다. 자식 사용법을 배우려면 약간의 노력이 필요하지만 수행 가능합니다. 귀하의 경우 다음 명령을 사용하여 작업을 완료하게됩니다.
$ mkdir /tmp/test
$ cd /tmp/test
$ git init
Initialized empty Git repository in /tmp/test/.git/
$ touch gitfile
$ git add gitfile
$ git commit -m "initial commit"
[master (root-commit) 31efd12] initial commit
0 files changed
create mode 100644 gitfile
$ git checkout -b m1-branch
Switched to a new branch 'm1-branch'
$ cat m1 >> gitfile
$ git add gitfile
$ git commit -m "m1 content"
[m1-branch 420b423] m1 content
1 file changed, 3 insertions(+)
$ git checkout -b m2-branch master
Switched to a new branch 'm2-branch'
$ cat m2 >> gitfile
$ git add gitfile
$ git commit -m "m2 content"
[m2-branch c4c525a] m2 content
1 file changed, 3 insertions(+)
$ git checkout master
Switched to branch 'master'
$ git merge m1-branch m2-branch
Fast-forwarding to: m1-branch
Trying simple merge with m2-branch
Simple merge did not work, trying automatic merge.
Auto-merging gitfile
ERROR: content conflict in gitfile
fatal: merge program failed
Automatic merge failed; fix conflicts and then commit the result.
$ cat gitfile
hello there
<<<<<<< .merge_file_qRmZJF
my friend
=======
my chum
>>>>>>> .merge_file_BUlXHH
how are you
$
답변 해 주셔서 감사합니다. 위의 편집을 참조하십시오. – ewok