Git

Last Updated: 8/23/2023

Working with Branches

Create branch

git branch bugfix

List branches

git branch

View current branch

git status

Switch branch

git switch bugfix

Rename branch

git branch -m bugfix bugfix-signup-form

Delete branch

  • By default, git prevents us from accidentally deleting the branch if there are any changes or unmerged
git branch -d bugfix-signup-form

force delete

git branch -D bugfix-signup-form

View commits across branches

git log --oneline --all