Lesson 4 / 20
Pushing & Cloning
Send commits to GitHub with git push and copy a full repository to a new machine with git clone.
Pushing changes
Once a remote is set, git push sends new commits to GitHub for others to see.
git push origin mainCloning a repo
git clone downloads the full history of a repo and sets up origin automatically — ready to work immediately.
git clone https://github.com/username/my-app.gitQuick check: Which command downloads a full copy of a remote repository, including its history?
- git remote add origin
- git push
- git clone
- git fetch only
Answer
git clone — `git clone` copies the entire repository, while `git remote add` only links an existing local repo to a URL.