Skip to content
techsnow

Branches

Creating Branches

A branch is a separate line of work. You can build a feature or fix a bug on its own branch without touching the main code. When it's ready, you merge it back.

git branch                  # list branches
git switch -c login-page    # create a new branch and move to it
git switch main             # go back to main
git branch -d login-page    # delete a branch after merging