Once your local repo is linked to GitHub, push and pull are how changes flow between your machine and the remote.


Pushing your work

Push uploads your local commits to GitHub, making them visible to anyone with access to the repository. The first push on a new branch usually sets the upstream connection too.

Pulling updates

Pull downloads new commits from GitHub and merges them into your current branch in one step, keeping your local copy up to date with everyone else's work.

Fetch vs pull

Fetch downloads new commits from GitHub without merging them into your branch automatically, letting you review changes before deciding to merge.

>_ COMMANDS YOU'LL USE
git push -u origin mainPush commits and set the upstream branch for future pushes
git pushUpload local commits to the connected remote branch
git pullDownload and merge remote changes into your current branch
git fetchDownload remote changes without merging them yet
💡Pull before you start new work each day — it keeps your branch close to what your team has already shared.
⚠️Common mistake: Forgetting to pull before pushing