일단 병합 커밋이 만들어지면 병합 수행 방법에 대한 정보가 유실됩니다. git merge
은 전략 모양 및 전략 별 옵션과 같이 충돌 모양에 영향을주는 다양한 옵션을 허용하기 때문에 중요합니다. 그러나 에 병합을 발견하는 합리적인 경우를이 기본 병합 옵션과 충돌 시키면 병합 강제 실행, 병합 커밋 실행, 병합 다시 작성 및 플래그 지정 자식 보고서.
참고 :이 스크립트는 여러 커밋을 체크 아웃하고 모든 반복에서 git reset --hard
및 git clean -fdx
까지 실행합니다. git에서 알 수없는 중요한 파일이없는 체크 아웃에서만 실행하십시오! 아무도 관심이 경우
#!/bin/bash
old_branch=$(git symbolic-ref --short HEAD)
for commit in `git rev-list --merges HEAD`
do
# find the parents of the merge commit
parents=$(git log -1 --format=%P $commit)
fst=${parents%% *}
rest=${parents#* }
# check out the first parent
git checkout -q $fst
# merge with the rest of them
git merge --no-commit $rest >/dev/null 2>&1
# if there are any conflicts, print the commit and abort the merge
if git ls-files --unmerged | grep -q '^'; then
echo $commit
git merge --abort
fi
# get rid of changes so the next checkout doesnt complain
git reset -q --hard
git clean -fdxq
done
git checkout -q $old_branch
, 내가 너무 의욕에 같은 질문을했다 : http://stackoverflow.com/questions/15707690/how-can-i-find-all-the-merges-that-had - 수 쿠지 보관소 – macrobug