sparse checkout
기법으로 다른 프로젝트 git에 있는 여러 폴더 중 원하는 폴더만 현재 내가 진행 중인 프로젝트에 clone 하는 방법
예시)
https://github.com/ssm/new-project.git
에서front/src
폴더만clone
을 받아서 사용하고 싶을 때,
new-project
├── front
│ ├── Component
│ └── src
└── back
├── config
├── models
....
$ git init
$ git remote add origin '주소'
# git remote add origin https://github.com/nickname/new-project.git
$ git config core.sparsecheckout true
$ echo '폴더 경로/*' >> .git/info/sparse-checkout
# echo front/src/* >> .git/info/sparse-checkout
$ git pull origin main
참고
https://eventhorizon.tistory.com/20
https://bitlog.tistory.com/131