class Git::Commands::Checkout::Branch

Implements the ‘git checkout` command for switching branches

This command switches branches by updating the index and working tree to match the specified branch, and updating HEAD to point to that branch. It can also create new branches with the ‘-b` or `-B` options.

@example Typical usage

checkout = Git::Commands::Checkout::Branch.new(execution_context)
checkout.call('main')
checkout.call(b: 'feature-branch')
checkout.call('origin/main', b: 'feature-branch', track: true)
checkout.call('abc123', detach: true)
checkout.call('main', force: true)

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

@see Git::Commands::Checkout

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

@api private