Class: Git::Commands::Remote::Show Private

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

Shows information about one or more remotes, including fetch and push URLs and branch tracking information.

Examples:

Show information about a remote

show = Git::Commands::Remote::Show.new(execution_context)
show.call('origin')

Show cached information without contacting the remote

show = Git::Commands::Remote::Show.new(execution_context)
show.call('origin', n: true)

Show verbose output for multiple remotes

show = Git::Commands::Remote::Show.new(execution_context)
show.call('origin', 'upstream', verbose: 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(*name, **options) ⇒ Git::CommandLineResult

Execute the git remote show command

Parameters:

  • name (Array<String>)

    one or more remote names to inspect

  • options (Hash)

    command options

Options Hash (**options):

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

    show the remote URL after the remote name

    Alias: :v

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

    do not query remote heads with git ls-remote

    Uses cached information instead of contacting the remote server.

Returns:

Raises:

  • (ArgumentError)

    if unsupported options are provided

  • (Git::FailedError)

    if git exits with a non-zero exit status



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