git-switch
Switch between Git branches. tldr-pages
On several platforms
Several platforms
Switch between Git branches. Requires Git version 2.23+.
Switch to an existing branch
git switch branch_nameIdentifyCreate a new branch and switch to it
git switch --create branch_nameIdentifyCreate a new branch based on an existing commit and switch to it
git switch --create branch_name commitIdentifySwitch to the previous branch
git switch -IdentifySwitch to a branch and update all submodules to match
git switch --recurse-submodules branch_nameIdentifySwitch to a branch and automatically merge the current branch and any uncommitted changes into it
git switch --merge branch_nameIdentifySwitch to a tag or commit
git switch --detach tagIdentifySwitch to another remote's branch
git switch --track remote_name/branchIdentify