Class: Git::Commands::Remote::Prune Private

Inherits:
Base
  • Object
show all
Defined in:
lib/git/commands/remote/prune.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 prune command

Deletes stale remote-tracking refs that no longer exist on the named remote.

Examples:

Dry-run to preview which refs would be pruned

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

Prune stale tracking refs for a remote

prune = Git::Commands::Remote::Prune.new(execution_context)
prune.call('origin')

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(*name, **options) ⇒ Git::CommandLineResult

Prune stale remote-tracking refs for one or more remotes

Parameters:

  • name (Array<String>)

    one or more remote names to prune

  • options (Hash)

    command options

Options Hash (**options):

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

    report what would be pruned without deleting refs

    Alias: :n

Returns:

Raises:

  • (ArgumentError)

    if unsupported options are provided

  • (Git::FailedError)

    if git exits with a non-zero exit status



# File 'lib/git/commands/remote/prune.rb', line 39