【发布时间】:2012-02-20 14:17:52
【问题描述】:
我在~/.janus/ 有一个 git 仓库,里面有一堆子模块。我想在~/.janus/snipmate-snippets/snippets/ 中添加一个子模块,但是当我在snipmate-snippets 目录中运行git submodule add <git@github.com:...> 时,我收到以下错误消息:
You need to run this command from the toplevel of the working tree.
所以问题是:如何将子模块添加到snipmate-snippets 目录?
【问题讨论】:
-
进入 git repo 的根目录以获取子模块命令将不再是必需的(很快)。见my answer below
-
git submodule add -b <branch> <url> <relative_path_4m_root>
标签: git git-submodules