Skip to content

Git submodules

Sébastien LUCAS edited this page Feb 21, 2016 · 9 revisions

Links

Alternatives to git submodules
https://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/

###Clone a module with submodules

To download automatically submodules of a git repo You need to do

  • git submodule init
  • git submodule update

The problem with this is that

  • the submodules are cheched out in a detached head state
  • there is no .git folder in the submodule but a .git file that reference a git folder inside the main repo

when the following repo is itself in a repo, I have this error fatal: Not a git repository: /SEB/www/archiref/archiref_theme/.git/modules/compass/sass/ia_mix fatal: 'git status --porcelain' failed in submodule default/themes/archiref_sky

It's due to the fact that I use to rsync my files to the server, and the local macbook path is saved in this files.

The alternative, is to manually clone the sub repo, take more time but more secure.

On Mac

WIKI by Sébastien Lucas CEO & Funder or Bricks

Clone this wiki locally