Branches
Chester Wyke October 28, 2023 Updated: April 26, 2025 #GitSource: https://www.nobledesktop.com/learn/git/git-branches
See branches
NB: The current branch will have a *
next to it.
Both local and remote
Remote only
Local only
Checkout a branch
Use git switch
or git checkout
followed by the branch name.
Prefer switch
as checkout
has other functionality that it can do to restore files as per SO and switch
was introduced to be used for changing branches.
Note do not include the remote/origin
in the command it will automatically create the local branch and set it up to track the remote branch.
Eg to check out develop use:
Create a branch
Source: https://www.atlassian.com/git/tutorials/using-branches/git-checkout
Create Only
Create and checkout
Delete a remote tracking branch after the branch has been deleted on the remote
- r is for remote
- d is for delete