class Git::Commands::Branch::Delete
Implements the ‘git branch –delete` command for deleting branches
@example Delete a single branch
delete = Git::Commands::Branch::Delete.new(execution_context) result = delete.call('feature-branch')
@example Delete multiple branches
delete = Git::Commands::Branch::Delete.new(execution_context) result = delete.call('branch1', 'branch2')
@example Force delete (works even if not merged)
delete = Git::Commands::Branch::Delete.new(execution_context) result = delete.call('feature-branch', force: true)
@example Delete remote-tracking branch
delete = Git::Commands::Branch::Delete.new(execution_context) result = delete.call('origin/feature', remotes: true)
@note ‘arguments` block audited against git-scm.com/docs/git-branch/2.53.0
@see git-scm.com/docs/git-branch git-branch
@api private
Public Instance Methods
Source
# File lib/git/commands/branch/delete.rb, line 82 def call(*, **) super end
Executes the git branch –delete command to delete branches
@overload call(*branch_name, **options)
@param branch_name [Array<String>] one or more branch names to delete @param options [Hash] command options @option options [Boolean, nil] :force (nil) allow deleting the branch irrespective of its merged status, or whether it even points to a valid commit Equivalent to the `-D` shortcut (`--delete --force`) Alias: :f @option options [Boolean, nil] :remotes (nil) delete remote-tracking branches Use this together with `--delete` to remove remote-tracking branches that no longer exist in the remote repository, or if `git fetch` was configured not to fetch them again Alias: :r @return [Git::CommandLine::Result] the result of calling `git branch --delete` @raise [ArgumentError] if no branch names are provided @raise [ArgumentError] if unsupported options are provided @raise [Git::FailedError] if git exits outside the allowed range (exit code > 1) @api public
Calls superclass method
Git::Commands::Base::call