Module: BasicSubmodules

Included in:
Git::Base
Defined in:
lib/git/basic_submodules.rb

Instance Method Summary collapse

Instance Method Details

#update_submodules(**options) ⇒ Object

Examples:

Initialize all git submodules

>> repo = Git.clone("[email protected]:puppetlabs/facter.git", "facter", path: Dir.mktmpdir)
=> <Git::Base>
>> repo.checkout "3.1.3
=> <String>
>> repo.update_submodules(init: true)
=> <String>

Parameters:

  • options (Hash)

    any options to pass to ‘git submodule update`

Options Hash (**options):

  • :init (Boolean)

    whether to initialize submodules when updating them

  • :use (Boolean)

    the submodule’s remote-tracking branch instead of superproject’s SHA1 sum

  • :no-fetch (Boolean)

    don’t fetch new objects from the remote site.

  • :force (Boolean)

    remove submodule’s working tree even if modified

  • :checkout (Boolean)

    checkout submodules in detached HEAD state

  • :merge (Boolean)

    merge recorded commit for submodule into the current branch of the submodule

  • :rebase (Boolean)

    rebase current branch of submodule onto the commit recorded in the superproject

  • :recursive (Boolean)

    recurse into nested submodules



38
39
40
# File 'lib/git/basic_submodules.rb', line 38

def update_submodules(**options)
  self.lib.update_submodules(options)
end