All commands must be prefixed with
git, and many have optional flags, passed in with the-To view the full functionality of each command and all possible flags, append--helpto the end of the command in the terminal
git status
displays the state of the working directory, including the branch, and details which changes have been staged or not, and any untracked files
git fetch
downloads contents, such as new branches, pushed to Github
git pull
updates the local version with changes pushed to Github
git branch
lists the branches for the repository and the current branch
branch_namegit checkout
switches to a different branch
branch_name and changes the current branch to this new branchgit commit
creates a permanent unique hash associated with all of the changes currently staged
git add
Adds files or changes to be staged for the next commit
git rm
Removes files or chances from being staged for the next commit
git push
Pushes commits from your local repository to Github
git merge
Combines changes from GitHub with local changes or commits
git rebase
Resets the current branch to start at the newest version of the branch specified in the command, redoing all commits on the current branch on top of the branch specified, stopping for you to resolve merge conflicts as necessary
git log
Displays information about the previous commits such as their hash, commiter, and time, starting from the most recent commits
git reflog
Displays information about what branches were recently changed in what order on your local machine
Can be helpful when undoing a rebase
git reset
Discards any local changes to the file specified
git cherry-pick
Adds the commit changes associated with the commit hash (which can be from another branch!) to the current branch