View

728x90
반응형
▶ 메인 프로젝트 (main_project)

application
  ㄴsubmodule
    ㄴ <서브 프로젝트>
        
        
▶ 서브 프로젝트 (sub_project)        
application
  ㄴfontweb  <---------- 여기에 있는 디렉토리만 submodule로 추가하고 싶을 경우
  ㄴetc

 

git submodule 특정 디렉토리 추가 방법

1. git 파일 생성

git init

2. git clone (--no-checkout) 빈 디렉토리로 복사

git clone --depth=1 --no-checkout https://github.com/yscho03/sub_project.git sub_project

3. git submodule 추가

git submodule add https://github.com/yscho03/sub_project.git sub_project

4. git 메인 프로젝트와 파일 연결

git submodule absorbgitdirs

5. sparse-checkout 설정

git -C sub_project config core.sparseCheckout true

6. 특정  디렉토리 지정

echo 'application/frontweb/*' >>.git/modules/sub_project/info/sparse-checkout

7. git 업데이트

git submodule update --force --checkout sub_project

 

728x90
반응형

'DevOps' 카테고리의 다른 글

Docker Container 리소스 할당  (0) 2023.07.27
Elasticsearch Snapshot S3 설정 방법  (0) 2023.01.10
WSL2 포트 포워딩 방법  (0) 2022.05.30
WSL2 - SSH 설정 및 접속  (0) 2022.05.30
GitLab Runner 설치 및 등록  (0) 2022.05.25
Share Link
reply
«   2026/05   »
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
31