---
name: "git-branchless-switch"
section: "1"
platform: "linux"
package: "git-branchless"
version: "0.11.1-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/git-branchless-switch"
---

# git-branchless-switch(1)

Switch to the provided branch or commit

## NAME

switch - Switch to the provided branch or commit

## SYNOPSIS

**switch** \[**-i**\|**--interactive**\] \[**-c**\|**--create**\] \[**-f**\|**--force**\] \[**-m**\|**--merge**\] \[**-d**\|**--detach**\] \[**-h**\|**--help**\] \[*TARGET*\]

## DESCRIPTION

Switch to the provided branch or commit

## OPTIONS

- **-i**, **--interactive**

  Interactively select a commit to check out

- **-c**, **--create** *\<BRANCH\_NAME\>*

  When checking out the target commit, also create a branch with the provided name pointing to that commit

- **-f**, **--force**

  Forcibly switch commits, discarding any working copy changes if necessary

- **-m**, **--merge**

  If the current working copy changes do not apply cleanly to the target commit, start merge conflict resolution instead of aborting

- **-d**, **--detach**

  If the target is a branch, switch to that branch and immediately detach from it

- **-h**, **--help**

  Print help (see a summary with '-h')

- \[*TARGET*\]

  The commit or branch to check out. If not provided, defaults to the current commit.

  If a revset is provided, it must evaluate to set with exactly 1 head.

  If this is provided and the \`--interactive\` flag is passed, this text is used to pre-fill the interactive commit selector.
