Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

2.10 Git and GitHub Cheat Sheet

About 99% of the commands you’ll type in git are summarized in the table below:

FunctionalityGit Command
See active branch and uncommitted changesgit status
Change branchgit checkout <branch name>
Create new branch and change to itgit checkout -b <new branch name>
Stage file changesgit add <filename>
Commit staged changesgit commit -m "message describing changes"
Push committed changes to remote branchgit push origin <branch name>
Update local information from upstreamgit fetch upstream
Merge upstream main into local maingit checkout main then git merge upstream/main
Merge local main into your feature branchgit checkout <feature branch> then git merge main
List current tagsgit tag
Create a new taggit tag -a v<version number> -m "message with new tag"
Fast-forward local branch from a remote when possiblegit pull --ff-only
See unstaged changesgit diff
See staged changesgit diff --staged
Clone a remote repositorygit clone <url to remote repo>