티스토리 뷰

[업데이트 2018.11.16 16:40]


Git에서 하위 디렉토리 및 디렉토리 파일만 clone하고 싶을 때 다음과 같이 수행 할 수 있습니다. (Windows 10 기준)


1. Powershell을 수행합니다.


2. git init project01

   cd project01


3. git config core.sparseCheckout true


4. git remote add -f origin https://github.com/asyncbridge/tsinghua-tencent-100k.git


5. echo "code/caffe/*"> .git/info/sparse-checkout

   아래와 같은 폴더 구조를 가정했을 때, code/caffe 하위 디렉토리만 clone하기 위해서 "code/caffe/*" 라 지정합니다.

   * windows cmd.exe에서 수행하면 에러가 발생하니, Powershell에서 수행합니다.


  |__ code
        |__ caffe
            |__ ...					
        |__ model
            |__ snapshots
            |__ model.caffemodel
            |__ model.prototxt
            |__ solver.prototxt
            |__ train_val.prototxt
        |__ python		
            |__ my-data-show.ipynb	
            |__ my-deployer.ipynb
            |__ my-eval-graph.ipynb
            |__ my-eval.ipynb			
            |__ ...						
        |__ results
            |__ ours_result_annos.json
            |__ ...			
        |__ script			
            |__ 1_convert_lmdb.sh
            |__ 2_calc_img_mean.sh
            |__ clean.sh
            |__ compile.sh
            |__ config.sh
            |__ prepare.sh
            |__ train.sh


6. git pull origin master


* 참고

[1] https://stackoverflow.com/questions/600079/how-do-i-clone-a-subdirectory-only-of-a-git-repository

[2] https://stackoverflow.com/questions/23289006/on-windows-git-error-sparse-checkout-leaves-no-entry-on-the-working-directory/23289007

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함