git branch | |
git branch -r | |
git branch -a | View all branches (local and remote) |
git branch --merged | View branches merged to current branch |
git branch --no-merged | View branches not merged to current branch |
git branch -m <new-branch> | Rename current branch to new-branchgit branch -m <new-branch> |
git branch -M <new-branch> | Force rename current branch to new-branchgit branch -M <new-branch> |
git branch -m <old-branch> <new-branch> | Rename old-branch to new-branchgit branch -m <old-branch> <new-branch> |
git branch -M <old-branch> <new-branch> | Force rename old-branch to new-branchgit branch -M <old-branch> <new-branch> |
git checkout <branch-name> | Switch to specified branchgit checkout <branch-name> |
git branch <new-branch> | |
git branch --track <new> <remote> | Create and track remote branchgit branch --track <new> <remote> |
git branch -d <branch-name> | Delete local branchgit branch -d <branch-name> |
git tag | |
git tag <tag-name> | Create tag based on latest commit |
git tag -d <tag-name> | |