git branch

Updated: 05 November 2023

Create a branch and switch to it at the same time

git checkout -b iss53

Delete a remote branch

git push origin --delete feature/login

Delete a remote tracking branch

git branch -d -r remote-name/branch-name

Remove upstream info for the_branch.

git branch the_branch --unset-upstream

Delete a local branch

git branch -d branch-name

Rename a branch

git branch -m <old> <new>

List all branches

git branch -a

Move branch pointer to another arbitrary commit

git branch --force <branch> <commit>