요약 한 단계는 기본적으로 정확합니다. --dir
옵션은 공유 드라이브에 출력을 지정해야하는 경우 유용 할 수 있습니다. --series
(-s
) 옵션은 전체 패치 세트를 가져 오려는 경우에 유용합니다. 당신이 당신의 예에서했던 것처럼 마다 패치를 가져 오지 않는 경우
# On Machine A (existing StGit repo with all patches applied)
$ stg export --dir /y/projects/ttc_dev_stg_patches/master
Checking for changes in the working directory ... done
# On Machine B ('pristine' StGit repo with no patches)
$ stg series [<-- should have no output!]
$ stg import -s /y/projects/ttc_dev_stg_patches/master/series
Checking for changes in the working directory ... done
Importing patch "remove-stl-at" ...
Invoking the editor: "vim .stgitmsg.txt" ... done
done
Importing patch "wldap32-fix" ...
Invoking the editor: "vim .stgitmsg.txt" ... done
done
Importing patch "cmake-fixes" ...
Invoking the editor: "vim .stgitmsg.txt" ... done
done
Now at patch "cmake-fixes"
, 당신은 개별적으로 지정할 수 있습니다 : 나는 새로운 기계에 STG의 자식 작업 복사본을 초기화하는 작업에서이에게 많이 사용 .
또 다른 공통 요구 사항은 여러 작업 복사본 (가능하면 다른 시스템)의 패치를 동기화하는 것입니다. stg sync
이 경우에 사용할 수있는 명령입니다
# On Machine B (existing StGit repo)
$ stg series
+ remove-stl-at
+ wldap32-fix
> cmake-fixes
$ stg sync --all -s /y/projects/ttc_dev_stg_patches/master/series
Checking for changes in the working directory ... done
Popping patches "cmake-fixes" - "wldap32-fix" ... done
Synchronising "remove-stl-at" ... done (updated)
Fast-forwarded patch "wldap32-fix"
Synchronising "wldap32-fix" ... done
Fast-forwarded patch "cmake-fixes"
Synchronising "cmake-fixes" ... done (updated)
지금까지 이상의 부모가 개정 uncommit하려고에 대한 오류와 같은 : 당신은 기본적으로이 작업을 수행 할 수 있습니다. stg-uncommit(1) 매뉴얼 페이지에서 :
정확히 하나의 상위가있는 커밋 만 커밋 될 수 있습니다. 다른 단어에서는 병합을 커밋 할 수 없습니다.
이것은 의미가 있습니다. 역사가 선형 적이 지 않으면 StGit은 어떤 부모의 커밋을 사용해야하는지 알 길이 없습니다. 필요에 따라 가능한 해결 방법은 부모 중 한 곳에서 임시 분기를 만들고 다른 부모로부터 필요한 커밋을 선택하는 것입니다. 그러면 패치 시리즈를 만들기 위해 stg uncommit
을 실행할 수있는 선형 히스토리가 작성됩니다. 특정 소스 트리 스냅 샷에 깔끔하게 적용될 패치 세트를 생성하려는 경우라면 괜찮습니다. 그러나 이보다 더 복잡한 작업을 수행하는 경우이 접근법에 문제가 발생할 가능성이 큽니다. (더 어려운 문제입니다. 더 많은 관점을 보려면 this question을 참조하십시오.)