Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save akhdaniel/b43854adacdee1bae354bdceb7319a2e to your computer and use it in GitHub Desktop.
Save akhdaniel/b43854adacdee1bae354bdceb7319a2e to your computer and use it in GitHub Desktop.
Switching to another branch in git. Straightforward answer
Switching to another branch in git. Straightforward answer,
git-checkout - Switch branches or restore working tree files
git fetch origin <----this will fetch the branch
git checkout branch_name <--- Switching the branch
Before switching the branch make sure you don't have any modified files, in that case, you can commit the changes or you can stash it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment