class Git::Commands::Branch::Copy

Implements the ‘git branch –copy` command for copying branches

This command copies a branch, together with its config and reflog. If the old branch name is omitted, copies the current branch.

@example Copy the current branch

copy = Git::Commands::Branch::Copy.new(execution_context)
copy.call('new-branch-name')

@example Copy a specific branch

copy = Git::Commands::Branch::Copy.new(execution_context)
copy.call('old-branch-name', 'new-branch-name')

@example Force copy (overwrite existing branch)

copy = Git::Commands::Branch::Copy.new(execution_context)
copy.call('old-branch', 'existing-branch', force: true)

@note ‘arguments` block audited against git-scm.com/docs/git-branch/2.53.0

@see Git::Commands::Branch

@see git-scm.com/docs/git-branch git-branch

@api private