Mundhra LabsGitHub, Gently
Stop 4 of 7·5 min read·1 thing to try

Push, pull and clone move commits around

Your laptop and GitHub each hold a copy of the repo. These words are how commits travel between the two.

Push and pull feel natural? Skip to stop 5 →

In shortClone once, then pull to get changes and push to share yours.

CloneDownload a repo from GitHub for the first time, with its whole history. You do this once per computer.
PushSend your new commits up to GitHub.
PullBring other people's new commits down, and fold them into your copy.
FetchCheck what's new on GitHub without changing your files yet. A peek before a pull.
Try it: keep two copies in stepGreen: yours. Amber: a teammate's.

Your laptop local

GitHub remote·origin

statusBoth copies match. Make a commit on your laptop, then push it.

Why did my push get rejected?

Try it above: let a teammate push, then commit and push yourself. GitHub refuses, because it has commits you haven't seen. It won't let you overwrite them blindly. The fix is always the same: pull first, then push.

The habit that prevents most trouble: pull when you sit down to work, push when you get up. Small, frequent pushes are much easier to combine than one huge one.

Is it like Dropbox?

Close, with one big difference: nothing syncs by itself. That's deliberate. Half-finished work stays on your laptop until you decide it's ready to share.