How to switch to an another branch in Git?
Use git switch with the branch name. The older command git checkout also works.
git switch develop
git checkout develop
Git changes the files of your folder to match the branch. If you have uncommitted changes which conflict with the other branch, Git stops you. Then commit them, or put them aside with git stash.
To go back to the previous branch, use git switch -. More in Git Checkout and Switch.
Learn more about the similar topics:
| Tutorials |
|---|
| Git Branch |
| Git Checkout and Switch |
| Git Merge |
| Git Merge Conflict |
| Git Rebase |
| Git Cherry Pick |
| Git Branching Strategy |