Git子模块新版本更新

hug*_*gie 5 git git-submodules

我已经分叉了MapBox-ios-sdk并对其进行了一些更改.更新版的sdk就在这里,我将更改合并到了fork中.MapBox-ios-sdk还包含SMCalloutView,它是MapBox-ios-sdk中的子模块.然而,官方sdk的版本使用了更新的,更新的SMCalloutView,它不在我的分支中.

我如何让它更新

我用这里的说明更新了我的sdk .但是,这不会更新SMCalloutView.我也尝试过git submodule update --recursiveMapBox-ios-sdk的级别,没有任何反应.事实证明,这是因为SMCallOutView处于"无分支"状态.为什么它在"没有分支"?如何将所有子模块置于"无分支"状态之外?如果它处于"无分支",那么我永远不会知道需要更新的子模块(或甚至更多嵌套)的子模块或子模块.

Von*_*onC 18

使用git 1.8.2 +(2013年3月),您可以定义一个子模块,该子模块将反映给定分支的最新提交.
请参阅" git submodule tracking latest ".

这意味着这足以将子模块更新为最新的分支:

# --remote will also fetch and ensure that
# the latest commit from the branch is used
git submodule update --remote
Run Code Online (Sandbox Code Playgroud)

有关该选项的更多信息,请参阅git repo commit 06b1ab--remote.


回顾一下: