'submodule'에 해당되는 글 2건

  1. 2018.07.24 [GIT] git submodule 삭제 하기
  2. 2018.07.04 [Jenkins] Gradle 을 이용한 submodule update 이슈

[GIT] git submodule 삭제 하기

ITWeb/개발일반 2018. 7. 24. 07:44

이것도 복습 차원에서 정리해 봅니다.


Step 1)

  helloworld project root 로 이동 합니다.

  $ cd helloworld

 

Step 2)

  .gitmodules 를 열어서 삭제할 모듈을 지워 줍니다.

  helloworld$ vi .gitmodules

 

Step 3)

  삭제 하고자 하는 submodule 의 cache 를 삭제 합니다.

  helloworld$ git rm --cached hi-module

   

  아래와 같은 에러는 무시 하시거나 아래 명령 실행 후 위 명령어를 실행 합니다.

  $ git submodule deinit <path_to_submodule>

   

  fatal: Please stage your changes to .gitmodules or stash them to proceed

 

Step 4)

  .git 내 남아 있는 submodule 을 삭제 합니다.

  helloworld$ rm -rf .git/modules/hi-module

   

Step 5)

  해당 프로젝트에서 submodule 을 추가 한 것을 삭제 합니다.

  remove module (into intellij project)

   

Step 6)

  최종 submodule 을 삭제 합니다.

  helloworld$ rm -rf hi-module

   

Step 7)

  commit & push 합니다.

  helloworld$ git commit -m 'remove submodules'

  helloworld$ git push


:

[Jenkins] Gradle 을 이용한 submodule update 이슈

ITWeb/개발일반 2018. 7. 4. 07:53

Jenkins 에서 Gradle 을 이용한 multi project(submodule) build 시 참고사항

젠킨스 소스 관리영역에서 Additional Behaviours 설정을 추가 해줘야 합니다.


- Advanced sub-modules behaviours

여기서 총 세 가지 항목을 선택 하게 됩니다.


- Recursively update submodules

이 설정은 --recursive 옵션을 사용합니다.


- Update tracking submodules to tip of branch

이 설정은 --remote 옵션을 사용합니다.


- Use credentials from default remote of parent repository

이 설정은 parent project 의 credential 을 사용 한다는 의미 입니다. 


여기서 제가 경험한 문제는 submodule 이 업데이트 되지 않는 문제였습니다.

intellij 에서 Project Update 기능과 비슷하다고 보시면 될 것 같은데요.


이 와 같은 기능을 적용하기 위해서는 위 2번째 옵션을 선택해줘야 합니다.


- Update tracking submodules to tip of branch

이 옵션의 의미는 submodules 의 변경된 내용을 업데이트 하기 위한 것입니다.


참고문서)

https://git-scm.com/docs/git-submodule#git-submodule---remote



: