2010年5月19日 星期三

git submodule

At git super project root directory:

git submodule add <git repo> path/to/put/the/repo;
git commit(always remember to checkin the submodule changes)

For first checkout superproject, or for any reason submodule directory is removed and needed to recover again:
git submodule init;
git submodule update;

To make changes in submodule, note that submodule are in (no branch) state initially:
cd <submodule>
git branch;(in submodule, always remember to check the branch state before commit)
git co <branch> (in submodule, if in (no branch) state)
git commit (in submodule)
git push (in submodule, if needed)
cd .. (go to superproject)
git add <submodule> (in superproject, note not "git add <submodule>/", it means a totally different thing)
git commit (in super project, to update the superproject to reference the new commit)




GitSubmoduleTutorial
https://git.wiki.kernel.org/index.php/GitSubmoduleTutorial

Git submodules in N easy steps
http://johnleach.co.uk/words/archives/2008/10/12/323

Submodules
http://book.git-scm.com/5_submodules.html

git-submodule(1) Manual Page
http://www.kernel.org/pub/software/scm/git/docs/git-submodule.html

git submodule
http://blogger.godfat.org/2009/02/git-submodule.html

git submodule
http://www.manic.tw/blog/post/23876945
Re: git-status and git-diff now very slow in project with a submodule
http://www.spinics.net/lists/git/msg131654.html
git config status.submodulesummary false

it doesn't work!!??

沒有留言: