Here are the most used and most common Git commands. This text assumes your primary branch is called main
.
Command | Effect |
---|---|
git status |
Will report the status of files changed on the local filesystem. Always check this status before messing around with checkouts, branches, pushes, pulls, etc. |
git checkout -b {branch} |
Create, and switch over to a new branch; this is how you make a new branch to work in. |
git checkout {branch} |
Goes to an existing branch; e.g., git checkout main . |
git branch |
See a list of branches. |