git is a version control system that lets you manage and keep track of your source code history and is responsible for everything GitHub related that happens locally on your computer. GitHub is a cloud-based hosting service that lets you manage Git repositories.
A cheat sheet for Git workflows
Local Setup
Configures user information used across all local repos
Command
What it does
git config --global user.name firstname lastname
sets a name to be associated
git config --global user.email valid-email
sets an email address to be associated
git config --global color.ui
autosets automatic command line color
git config --global init.defaultBranch <name>
sets local initial branch name to use in all new repos
Repo Setup & Init
Configuring user information, initializing and cloning repos
Command
What it does
git init
initializes an existing directory as a git repo
git clone url
retrieves an entire repo from a url
git clone url; cd <local_folder_name>
retrieves an entire repo from a url then creates and saves it to a specified local location
🍬 This section assumes the remote repo is represented by a remote or Git server 🍬
Pushing and Pulling
Command
What it does
git clone url
retrieves an entire repo from a url
git clone url; cd <local_folder_name>
retrieves an entire repo from a url then clones it to a specified local folder