git如何添加子模块以便方便使用别人维护的模块?

答: 添加过程如下:

1. 在当前项目的源码下执行一下命令来添加子模块

  git submodule add <other_repository_url> <dir_name>

  such as:

      git submodule add https://github.com/vim/vim.git vim

2. 在当前项目下提交添加子模块的commit

  git commit -s -m 'add submodule <module_name>' 

  such as:

      git commit -s -m 'add submodule vim'

posted @ 2019-06-21 15:25  Jello  阅读(984)  评论(0编辑  收藏  举报