Checking out (Switching Between) Branches
On this page:
Checking out an existing branch
- Invoke the Branches menu as described in Accessing Git Branches Popup Menu.
Select a branch in the pop-up list that shows all available local and remote branches, and choose Checkout
from the submenu.
What happens next depends on whether there are conflicts:
- If your working tree is clean and your local changes do not conflict with the specified branch, this branch will be checked out (a notification will popup in the bottom-left corner of the CLion window).
If you ware working with a dirty tree, and your local changes will be overwritten by checkout, CLion shows the files
that prevent you from checking out the selected branch, and suggests to choose between the
If you select
force checkout, your local changes will be overwritten (equivalent to the
git checkout -fcommand).
If you select
smart checkout, CLion will stash local changes, check out the selected branch, and then unstash the changes. If a conflict occurs during the unstash operation, you will be prompted to merge the changes.
Checking which branch is currently checked out
If you want to check which branch is you are currently working in, do one of the following:
- Look ath the widget in the Status bar:
- Invoke the Branches menu as described in Accessing Git Branches Popup Menu. . Check the current branch name in the bottom line: