CmdID

CmdID / Commands

git-switch

Switch between Git branches. tldr-pages

On several platforms

Opens CmdID with your command. It is read in your browser and sent nowhere.

Several platforms

from tldr-pages, CC BY 4.0

Switch between Git branches. Requires Git version 2.23+.

Switch to an existing branch

git switch branch_nameIdentify

Create a new branch and switch to it

git switch --create branch_nameIdentify

Create a new branch based on an existing commit and switch to it

git switch --create branch_name commitIdentify

Switch to the previous branch

git switch -Identify

Switch to a branch and update all submodules to match

git switch --recurse-submodules branch_nameIdentify

Switch to a branch and automatically merge the current branch and any uncommitted changes into it

git switch --merge branch_nameIdentify

Switch to a tag or commit

git switch --detach tagIdentify

Switch to another remote's branch

git switch --track remote_name/branchIdentify