


2) Yes, your collaborators can always edit. That is why I use pwd to get an absolute path in my example. Thus far I've just been rm -ing the module and re-adding it, but this is both wrong in principle and tedious in practice. David: 1) Adding a submodule with a relative path means something special to git submodule add: resolve it as relative to the containing repository’s origin remote. > snipmate-snippets/snippets/ If you need more information about submodules (or git in general) ProGit is pretty useful. I've also tried git fetch mod, which appears to do a fetch (but can't possibly, because it's not prompting for a password!), but git log and git show deny the existence of new commits. 5 Answers Sorted by: 594 You go into /.janus and run: git submodule add git submodule deinit: Removes a submodule from a repository. # At this point, ssh:// /git/mod changes submodule needs to change too. Here’s a quick cheat sheet that you can use to help you work with submodules: git add submodule: Adds a submodule to a repository git update submodule remote: Updates the submodules in a repository. Hello world.Ģ files changed, 4 insertions(+), 0 deletions(-) Remote: Total 131 (delta 54), reused 0 (delta 0) To create a submodule with a name that differs from the original repository's name, add the custom path to the git submodule add command: git submodule add repository-url custom-directory-path In the example below, Git clones the contents of the external repository into a subdirectory named custom-name. Initialized empty Git repository in /./foo/.git/ It doesn't do anything (no output, success exit code). If your repository is large, this option might make your build pipeline more efficient. Effectively this results in git fetch -depthn. Now, my understanding is that git submodule update should do this, but it doesn't. Select if you want to limit how far back in history to download. Commit B has been pushed to that URL, and I want the submodule to retrieve the commit and change to it.Add a git submodule update#