중첩된 Repository를 관리하기 위해 GIT에서 제공하는 기능
git submodule init
subtree는 프로젝트 dependency가 있어서 합쳐야 할 때
submodule은 루트단위로 관리할 필요가 없고 폴더별 nested하고 싶을 때, 따로 관리해도 될 때 dependency가 없을 때
서브모듈 루트 디렉토리의 경로와 원격 저장소의 주소를 관리
- 서브모듈을 Slave Repository
- Slave Repository의 변경사항이 있는 경우 Master 및 Slave 각각 두 번의 Commit
Commit은 반드시 Slave → Master의 순서
- Slave Repository는 Master Repository가 바라볼 때 Abstraction되는 방식으로 관리됩니다. 즉, Master Repository에서 Commit을 할 때 Slave Repository의 변화는 1개 변경사항으로 축약되어 추적(Tracking)

Seonglae Cho![[GIT] Submodule (Nested Repository) 사용하기 - ECE - TUWLAB](https://www.notion.so/image/https%3A%2F%2Fwww.tuwlab.com%2F.%2Ffiles%2Fattach%2Fimages%2F2382%2F011%2F026%2Fb870adfc79d2fbf16e444483fbdc2a19.png?table=block&id=8ba8944e-ed27-483b-8481-2b3a1c528de8&cache=v2)