코린이의 성장기

[github] 특정 하위 폴더만 clone하기

난나 NANNA 2021. 4. 29. 01:07
반응형

맨날 찾아보는데도 안외워져서 포스팅을 해야겠다ㅠ

 

1. clone할 저장소에서 git init

git init

2. sparseCheckout이 가능하도록 설정

git config core.sparseCheckout true

3. remote 추가

git remote add -f origin [git repo 주소]

4. clone할 하위 폴더를 지정 (ex. "srcs/main/blog" )

echo [클론할 하위 폴더] >> .git/info/sparse-checkout

5. git pull

git pull origin master

출처: allo-ew.tistory.com/11

반응형