Branching
git branch -a - List all branches in the local repo.
git branch <branch_name> - Create a new branch.
git branch -m <new_name> - Rename the current branch to the new name.
git branch -m <current_name> <new_name> - Rename a branch.
git branch -d <branch_name> - Delete a branch.
git branch -D <branch_name> - Force delete a branch (and all commits).
git switch <branch_name> - Move the HEAD to the specified branch (switch branches).
git switch -c <branch_name> - Create a new branch and immediately switch to it.
git checkout <branch_name> - Move the HEAD to the specified branch (switch branches).
git checkout -b <branch_name> - Create a new branch and immediately check out to it.
git checkout <commit_hash> - Move the HEAD to the specified commit (detached mode).