如何将子模块添加到子目录? [英] How do I add a submodule to a sub-directory?

查看:105
本文介绍了如何将子模块添加到子目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

〜/ .janus / 中有一个git repo,里面有一堆子模块。我想在〜/ .janus / snipmate-snippets / snippets / 中添加一个子模块,但是当我运行 git submodule时,添加< git @ github .com:...> snipmate-snippets 目录中,我收到以下错误消息:

 您需要从工作树的顶层运行此命令。 

所以问题是:如何将子模块添加到 snipmate- snippets 目录?

解决方案

您进入〜/ .janus 并运行:

  git submodule add< git @ github ...>如果您需要更多关于子模块(或一般的git)的信息 ProGit 非常实用。


I have a git repo in ~/.janus/ with a bunch of submodules in it. I want to add a submodule in ~/.janus/snipmate-snippets/snippets/, but when I run git submodule add <git@github.com:...> in the snipmate-snippets directory, I get the following error message:

You need to run this command from the toplevel of the working tree.

So the question is: How do I add a submodule to the snipmate-snippets directory?

解决方案

You go into ~/.janus and run:

git submodule add <git@github ...> snipmate-snippets/snippets/

If you need more information about submodules (or git in general) ProGit is pretty useful.

这篇关于如何将子模块添加到子目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆