DevOps
[Git]특정 폴더만 받아오기
no500
2022. 1. 27. 18:33
# 테스트폴더 생성
mkdir GitTest
# 폴더 이동
cd GitTest
# Git 초기화
git init
# 설정 활성화
git config core.sparseCheckout true
# Git remote 추가
git remote add -f origin ssh://root@10.3.205.62:22/git-repo/LOSTARK.git
# 체크아웃 폴더 정의
echo "WEB/CIOS/Auth/*"| out-file -encoding ascii .git/info/sparse-checkout
# Pull요청
git pull origin master
이슈
error: Sparse checkout leaves no entry on the working directory
sparse-checkout 파일이 기본적으로 UTF-8로 인코딩된다.
out-file -encoding ascii .git/info/sparse-checkout 옵션으로 ascii 저장해야함.
잡담
꼭 써야한다면 어쩔 수 없지만,
구조를 바꿀 수 있으면 바꾸자.