How to switch branche in git



When using git to manage code, multiple branches are usually created, usually the default is the master branch, we can use this command to switch to the branch2 branch


git checkout branch2


git :  is a free and open source distributed version
checkout :  switch branches or restore working tree files


Switched to branch 'branch2'
Was this helpful?

I hope to help every developer quickly find the commands they need. Of course, you can also add your own commonly used commands for easy searching.