git merge-file
(https://git-scm.com/docs/git-merge-file)을 사용하여 파일별로이 작업을 수행 할 수 있습니다. 많은 파일이 관련되어 있다면 매우 지루할 수 있습니다.
또는, 병합을 수행 할 임시 "통합 리포지토리"를 만들 수 있습니다.
mkdir merge-repo
cd merge-repo
git init
# copy in the previous imported version of each file
git add .
git commit -m base
git branch source
# copy in the current version of each file with your changes (note you're still on master)
git add .
git commit -m ours
git checkout source
# copy in the current version of each file from the source repo
git add .
git commit -m theirs
git checkout master
git merge source
# copy the merged files back to your repo
cd ..
rm -rf merge-repo #if you don't want to keep it around, you don't need it any more
후자가 더 움직이는 부분이있을 수 있습니다,하지만 난 당신이 스크립트를들을 수 있었다 내기하고 개별 merge-file
명령을 무대에 파일로 파일을가는 것보다 훨씬 덜 지루한 수 있습니다.
고마워요! git-merge-file에 대해서는 몰랐습니다. 이것은 실제로 스크립팅 된 프로세스의 일부입니다. 좋은 제안 :) –