Identity, SSH keys, and the config options that make git pleasant to work with daily
Git requires your identity before it will record any commit. Beyond the basics, a handful of config settings — aliases, default branch name, push behaviour, credential helper — save time and prevent confusion on every project. Getting this right once means you never have to think about it again.
SSH keys are how GitHub authenticates you for push and pull without a password prompt. Understanding the difference between HTTPS and SSH remotes prevents a common "permission denied" blocker when setting up a new machine.
Git config has three levels: system (/etc/gitconfig — all users on the machine), global (~/.gitconfig — your user account), and local (.git/config inside the repo). Each level overrides the one above it. Almost everything you set for personal use goes at the global level.
SSH authentication works via a key pair: a private key that stays on your machine and a public key you give to GitHub. GitHub uses the public key to verify that pushes and pulls are really from you — no password ever leaves your machine.
These are stamped into every commit. If you use a work machine, override email at the repo level: git config user.email "you@company.com" (no --global) inside that repo.
HTTPS remotes ask for a username/token each push unless you configure a credential helper. SSH remotes authenticate silently via your key — preferred for daily development.
The pull.rebase true and push.default current settings are the two most impactful for day-to-day workflow — they prevent accidental merge commits on pull and accidental pushes to the wrong branch.
git remote add origin <url>.origin automatically, and checks out the default branch. Use when the repo already exists on GitHub.