Working with Branches

Listing Branches

To see your local branches, use:

git branch

Expected output:

* main



To list all branches (including remote branches), use:

git branch -a

Expected output:

* main
  remotes/origin/main



To list Remote branches (including remote branches), use:

git branch -r

Expected output:

* remotes/origin/main


  • The branch marked with an asterisk (*) is your currently active branch.
  • Any changes or commits you make are added to this branch.

Tip:
Use branches to keep your work organized and your main branch stable!