Typorithm · easy

clone, remote & push

git-remote-pushgitcloneremotepush
Saved on this device
Full lesson · 8 learning steps Open any exercise for focused practice
1

Step 1 of 8 · intro card

Learn clone, remote & push

0%

Remote & Collab

git clone copies a remote repo and sets origin; git remote add registers a named remote URL; git push -u origin main publishes and records the upstream so later git push needs no arguments; git remote -v lists configured remotes.

git clone downloads a full copy of a remote repository, checks out its default branch, and automatically registers the source as a remote named origin.

If you start a repo locally instead, git remote add origin <url> attaches a named remote so Git knows where to push and pull. The name origin is just a convention.

git push -u origin main publishes your branch to origin and sets that remote branch as the upstream. After that, a bare git push (and git pull) knows where to go, and git remote -v shows the configured remotes.

01

git clone copies a repo and sets origin.

02

git remote add registers a named remote URL.

03

push -u sets the upstream so later git push needs no args.

git clone git@github.com:me/app.git
git remote add origin git@github.com:me/app.git
git push -u origin main
git push
git remote -v

Read the implementation

Connect each part of the code to the concept before you type.

1. Clone a repo

git clone copies a remote repository to your machine and registers it as origin.

git clone git@github.com:me/app.git

2. Add a remote

git remote add registers a named remote (origin) pointing at a URL.

git remote add origin git@github.com:me/app.git

3. Push & set upstream

push -u publishes the branch and sets its upstream so later pushes need no arguments.

git push -u origin main

4. Push to upstream

With an upstream set, a bare git push sends new commits to the tracked remote branch.

git push

5. List remotes

git remote -v prints each configured remote's name and fetch/push URLs.

git remote -v

A complete learning loop

01

Understand

Read the concept map and follow the code breakdown.

02

Reconstruct

Type the implementation, repair mistakes and work through every recall exercise.

03

Verify

Use the final check without hints; revisit weak concepts in short practice sessions.

clone, remote & push: Lesson & Practice · Typorithm | ApplyDjinn