Programming foundations

Stage 2 · Lesson 6 of 8

clone, fetch, pull and push

Command line and Git

A remote is another copy of the , usually on . origin is the default name for the one you cloned from. git clone copies a repository with its full history.

git fetch downloads new commits without touching your files. git pull fetches and then merges them into your current branch, and git push sends your commits up. git remote -v shows where each remote points.

A push is rejected when the remote has commits you do not have. Pull first, resolve any conflict, then push again. Never to a shared branch, because it overwrites other people's work.

Set up or a once, because GitHub does not accept your account password for Git operations.

A question to check yourself, an AI practice session and 1 cheat sheet entry come when you add the roadmap to your account. Add it

Resources for this stage

Start with· follow one of these

Practise

  • Draws the commit graph as you type, so merge and rebase stop being a mystery

  • Levels 0 to 15 build real shell reflexes: finding files, reading them, permissions

Keep handy

  • Free official book: read chapters 1 to 3, keep the rest for later

  • Recovery recipes for the day a commit goes wrong

Also worth your time

Mark this stage as not done?