Git submodule new version update

后端 未结 1 454
陌清茗
陌清茗 2020-12-06 07:45

I had forked a MapBox-ios-sdk and make some changes to it. A newer release of the sdk is here and I merged my the changes into my fork. MapBox-ios-sdk also incorporate SMCal

相关标签:
1条回答
  • 2020-12-06 08:01

    With git 1.8.2+ (March 2013), you can define a submodule which will reflect the latest commit of a given branch.
    See "git submodule tracking latest".

    It means this would be enough to update a submodule to the latest of a branch:

    # --remote will also fetch and ensure that
    # the latest commit from the branch is used
    git submodule update --remote
    

    See git repo commit 06b1ab for more on the --remote option.


    To recap:

    • For a new submodule (which must follow a branch):

      git submodule add -b [branch] [URL] [DirectoryName]
      
    • For an existing submodule that you now want it to follow a branch:
      See also git repo commit b92892, for transforming a git submodule into one which follows a branch.
      All you need to do is:

      git config -f .gitmodules submodule.<path>.branch <branch>
      

      See more at "Git submodules: Specify a branch/tag"

    0 讨论(0)
提交回复
热议问题