Class: Git::Commands::Branch::UnsetUpstream Private

Inherits:
Git::Commands::Base show all
Defined in:
lib/git/commands/branch/unset_upstream.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-branch/2.53.0

Implements the git branch --unset-upstream command for removing upstream tracking

This command removes the upstream tracking information for the given branch (or current branch if not specified).

Examples:

Unset upstream for current branch

unset_upstream = Git::Commands::Branch::UnsetUpstream.new(execution_context)
unset_upstream.call

Unset upstream for a specific branch

unset_upstream = Git::Commands::Branch::UnsetUpstream.new(execution_context)
unset_upstream.call('feature')

See Also:

Instance Method Summary collapse

Methods inherited from Git::Commands::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(branch_name = nil) ⇒ Git::CommandLine::Result

Execute the git branch --unset-upstream command

Parameters:

  • branch_name (String, nil) (defaults to: nil)

    the branch to remove upstream tracking for (defaults to current branch if omitted)

Returns:

Raises:



# File 'lib/git/commands/branch/unset_upstream.rb', line 38