class Git::Commands::Branch::Create

‘git branch` command for creating new branches

This command creates a new branch head pointing to the current HEAD or a specified start point.

@example Basic branch creation

create = Git::Commands::Branch::Create.new(execution_context)
create.call('feature-branch')

@example Create branch from a specific start point

create = Git::Commands::Branch::Create.new(execution_context)
create.call('feature-branch', 'main')

@example Force create (reset existing branch)

create = Git::Commands::Branch::Create.new(execution_context)
create.call('feature-branch', 'main', force: true)

@example Create with upstream tracking

create = Git::Commands::Branch::Create.new(execution_context)
create.call('feature-branch', 'origin/main', track: true)

@example Create without upstream tracking

create = Git::Commands::Branch::Create.new(execution_context)
create.call('feature-branch', 'origin/main', no_track: true)

@example Create with inherited tracking configuration

create = Git::Commands::Branch::Create.new(execution_context)
create.call('feature-branch', 'origin/main', track: 'inherit')

@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