두 개의 텍스트 파일이 있는데 몇 줄의 일부 변경 사항을 제외하면 거의 동일합니다. 이 두 파일을 차이점이 강조 표시된 단일 텍스트 파일로 병합하고 싶습니다. 그런 다음 편집기에서 병합된 파일을 보고 차이점을 수동으로 검토할 수 있습니다.
내 생각에 이것은 일반적으로 svn 병합 충돌에서 얻는 것과 다소 유사할 것입니다. 예를 들어 다음이 file1
포함됩니다.
Top piece of bread
Mayonnaise
Lettuce
Tomato
Provolone
Salami
Mortadella
Prosciutto
Creole Mustard
Bottom piece of bread
그리고 file2
다음을 포함합니다:
Top piece of bread
Mayonnaise
Lettuce
Tomato
Provolone
Sauerkraut
Grilled Chicken
Creole Mustard
Bottom piece of bread
병합된 파일에는 다음과 같은 내용이 포함될 것으로 예상됩니다.
Top piece of bread
Mayonnaise
Lettuce
Tomato
Provolone
<<<<<<< .file1
Salami
Mortadella
Prosciutto
=======
Sauerkraut
Grilled Chicken
>>>>>>> .file2
Creole Mustard
Bottom piece of bread
diff
어쩌면 내가 놓친 옵션이 있을까요 ?
답변1
OP가 추가된 최종 버전--changed-group-format
diff old-file new-file --old-group-format='<<<<<<< .old
%<=======
' --new-group-format='=======
%>>>>>>>> .new
' --changed-group-format='<<<<<<< .old
%<=======
%>>>>>>>> .new
'
이는
Top piece of bread
Mayonnaise
Lettuce
Tomato
Provolone
<<<<<< .old
Salami
Mortadella
Prosciutto
=====
Sauerkraut
Grilled Chicken
>>>>>>> .new
Creole Mustard
Bottom piece of bread