git --versionCheck Git is installed and see the version
git config --global user.nameSet your global Git username
git config --global user.emailSet your global Git email
git config --global --listVerify all global Git config settings
git config pull.rebase falseSet pull strategy to merge not rebase
git initInitialize a brand new local Git repo
git clone <url>Download a GitHub repo to your Mac โ one time only
git statusCheck local changes โ does NOT talk to GitHub
git add <file>Stage a specific file for commit
git add .Stage all changed files at once
git commit -m "message"Save a local snapshot โ does NOT touch main or GitHub
git pushSend local commits up to GitHub
git push -u origin mainFirst push โ links local branch to GitHub remote
git pullSync GitHub main โ local. Only way local main moves forward.
git pull origin main --allow-unrelated-historiesForce pull when repos have different starting points
git branch -m mainRename current branch to main
git remote add origin <url>Link local repo to a GitHub remote for the first time
git remote set-url origin <url>Update the GitHub remote URL on an existing repo