pushing, pulling, and working with remote repos
git remote -vshows what remotes are configured and their urls. good for sanity checking.
git remote add origin https://github.com/you/repo.gitconnects a local repo to a remote. you'd do this after git init on a fresh project.
git fetchdownloads changes from remote but doesn't apply them. safe — nothing in your working tree changes.
git pull --rebasefetches and rebases your local commits on top. cleaner than a regular git pull which creates a merge commit for no real reason.
git pushpushes your current branch to remote. first time on a new branch you'll need:
git push -u origin feature/my-thingthe -u sets upstream tracking so future git push and git pull just work.
git push -fforce push. rewrites the remote branch. only do this on your own feature branches, never on shared branches. if you've rebased or amended commits that were already pushed, you'll need this.