Files
30-seconds-of-code/git/snippets/switch-to-branch.md
2023-05-01 22:28:09 +03:00

402 B

title, type, tags, cover, dateModified
title type tags cover dateModified
Switch to a branch snippet
branch
bridge 2021-04-13T21:10:59+03:00

Switches to an existing branch.

  • Use git checkout <branch> to switch to the specified branch.
  • Note: In newer versions of git, you can also use git switch <branch>.
git checkout <branch>
git checkout patch-1 # Switches to the branch named `patch-1`