Class: Git::Commands::Remote::Update Private

Inherits:
Base
  • Object
show all
Defined in:
lib/git/commands/remote/update.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Note:

arguments block audited against https://git-scm.com/docs/git-remote/2.53.0

git remote update command

Fetches updates for remotes or remote groups in the repository. When neither a remote nor a group is specified, updates all remotes that are not marked with remote.<name>.skipDefaultUpdate.

Examples:

Fetch updates for all configured remotes

update = Git::Commands::Remote::Update.new(execution_context)
update.call

Fetch updates for a specific remote

update = Git::Commands::Remote::Update.new(execution_context)
update.call('origin')

Fetch updates and prune stale tracking refs

update = Git::Commands::Remote::Update.new(execution_context)
update.call('origin', prune: true)

See Also:

Instance Method Summary collapse

Methods inherited from Base

allow_exit_status, arguments, #initialize, requires_git_version, skip_version_validation

Constructor Details

This class inherits a constructor from Git::Commands::Base

Instance Method Details

#call(*remote_or_group, **options) ⇒ Git::CommandLineResult

Execute the git remote update command

Parameters:

  • remote_or_group (Array<String>)

    zero or more remote names or remote group names

  • options (Hash)

    command options

Options Hash (**options):

  • :verbose (Boolean, nil) — default: nil

    show remote URLs alongside remote names

    Alias: :v

  • :prune (Boolean, nil) — default: nil

    prune stale tracking refs while updating remotes

    Alias: :p

Returns:

Raises:

  • (ArgumentError)

    if unsupported options are provided

  • (Git::FailedError)

    if git exits with a non-zero exit status



# File 'lib/git/commands/remote/update.rb', line 46