美文网首页
git submodule

git submodule

作者: 43daf5f8181f | 来源:发表于2016-08-01 19:30 被阅读7次

    Cite: https://git-scm.com/book/en/v2/Git-Tools-Submodules#Starting-with-Submodules

    MainProject 只追踪 git submodulecommit, 不追踪其内容.

    Adding an existing Git repository as a submodule of the repository
    that we’re working on

    $ git submodule add j.ru@bl:~/git-server/data.git
    $ gcam "add data.git module"
    

    Cloning a Project with Submodules

    $ git clone j.ru@bl:~/git-server/MainProject
    $ cd MainProject
    $ git submodule init
    $ git submodule update
    
    # There is another way to do this. If you pass `--recursive` to the
    # `git clone` command, it will  automatically initialize and update 
    # each submodule in the repository.
    $ git clone --recursive j.ru@bl:~/git-server/MainProject
    

    在 submodule 中更新 submodule 内容

    $ gf
    $ gmom
    # 或者
    $ gl
    

    相关文章

      网友评论

          本文标题:git submodule

          本文链接:https://www.haomeiwen.com/subject/etffsttx.html