TOOL/VCS

[Git] Submodule

forgiveall 2016. 6. 18. 22:58

///// Git (깃)


체계적인 소스관리를 위해 


서브모듈 관리가 필요한 시점이 있다.




///// Submodule

- add submodule

git submodule add {gitRepositoryURL} {projectFolder}

git add --all

git commit -m 'add sj submodule'


- remove submodule

git submodule deinit -f {projectFolder}


- issue #1  “already exists in the index”

1. check submodule

git ls-files --stage {projectFolder}


2. remove submodule cache

git rm --cached {projectFolder}


3. readd submodule

git submodule add {gitRepositoryURL} {projectFolder}




///// 참고

6.6 Git 도구 - 서브모듈:

https://git-scm.com/book/ko/v1/Git-%EB%8F%84%EA%B5%AC-%EC%84%9C%EB%B8%8C%EB%AA%A8%EB%93%88


Issue with adding common code as git submodule: “already exists in the index”:

http://stackoverflow.com/questions/12898278/issue-with-adding-common-code-as-git-submodule-already-exists-in-the-index