this mailing list post에 설명 된 문제가 발생합니다. 'git subtree split'은 되돌리기 커밋 다음에 병합 커밋이있는 경우 기록을 재구성하지 못합니다. 나는 약간 자신의 메일 링리스트 게시물에 파비앙에서 제공하는 테스트 스크립트를 조정 한 :커밋을 되돌릴 때 'git subtree split'실패하는 법?
git init
# create a directory that is going to be split
mkdir doc
echo "TEST" > doc/README
git add doc
# commit A
git commit -a -m"first version"
# create a branch with a new commit (Z)
git checkout -b test
echo "TEST" > doc/README1
git add doc/README1
git commit -a -m"added README1"
git checkout master
# modify the README file (commit B)
echo "TEST_" > doc/README
git commit -a -m"second version"
# revert the change (commit C)
echo "TEST" > doc/README
git commit -a -m"revert second version"
# or use git revert HEAD^
# split
git subtree split --prefix="doc" --branch=TARGET
# add another commit (to a file *not* in the subtree dir)
echo "BLA" > BLA
git add BLA
git commit -a -m"third version"
# adding another commit to a file in the subtree dir will "fix" things
#echo "MEH" > doc/MEH
#git add doc
#git commit -a -m"fourth version"
# the log will show the 3 commits as expected (including B and C)
GIT_PAGER= git log --oneline TARGET
# merge the test branch
git merge -m"merged test" test
# attempt to re-split; this will fail
git subtree split --prefix="doc" --branch=TARGET
# see what history split generates
git subtree split --prefix="doc" --branch=TARGET2
내가 그 서브 트리 디렉토리의 변화를 만들어 커밋 되돌리기가 다른 뒤에 커밋 경우 예상대로 분할이 작동 것을 발견했다
(위의 "제 4 판"참조). git-subtree의 버그처럼 보입니다.
그러나 제 경우에는 병합이 이미 수행되었으므로 더미 커밋을 추가하여 문제를 해결할 수 없습니다. 이것 주위에 다른 방법이 있습니까? 아마도 git-subtree 소스 코드에 대한 빠른 픽스 패치일까요?