./categories/dev-ops
Git 서브모듈·서브트리
서브모듈
git submodule add <repo-url> pg/search
git add .gitmodules pg/search && git commit -m "Add submodule"
git submodule update --init --recursive
# 서브모듈 내부 수정 후
cd pg/search && git add . && git commit && git push
cd ../.. && git add pg/search && git commit && git push
서브트리
git subtree add --prefix=pg/search <repo-url> main --squash
git subtree pull --prefix=pg/search <repo-url> main --squash
서브트리→서브모듈 전환
git rm -r pg/search
git submodule add <repo-url> pg/search
git submodule update --init --recursive
./comments