How can I specify a branch/tag when adding a Git submodule?

前端 未结 12 1271
旧巷少年郎
旧巷少年郎 2020-11-21 06:39

How does git submodule add -b work?

After adding a submodule with a specific branch, a new cloned repository (after git submodule update --init

12条回答
  •  自闭症患者
    2020-11-21 07:00

    Git 1.8.2 added the possibility to track branches.

    # add submodule to track master branch
    git submodule add -b branch_name URL_to_Git_repo optional_directory_rename
    
    # update your submodule
    git submodule update --remote 
    

    See also Git submodules

提交回复
热议问题