Class: Git::Commands::Remote::Rename Private

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

Renames a remote and updates all its remote-tracking branches and configuration settings.

Examples:

Rename a remote

rename = Git::Commands::Remote::Rename.new(execution_context)
rename.call('origin', 'upstream')

Rename a remote with progress reporting

rename = Git::Commands::Remote::Rename.new(execution_context)
rename.call('origin', 'upstream', progress: true)

Suppress progress output during rename

rename = Git::Commands::Remote::Rename.new(execution_context)
rename.call('origin', 'upstream', no_progress: 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(old, new, **options) ⇒ Git::CommandLineResult

Execute the git remote rename command

Parameters:

  • old (String)

    the current remote name

  • new (String)

    the new remote name

  • options (Hash)

    command options

Options Hash (**options):

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

    enable progress reporting (--progress)

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

    suppress progress output (--no-progress)

Returns:

Raises:

  • (ArgumentError)

    if unsupported options are provided

  • (Git::FailedError)

    if git exits with a non-zero exit status



# File 'lib/git/commands/remote/rename.rb', line 45