# Pushing & Cloning — GitHub Fundamentals: Collaboration, Pull Requests and Actions

Source: https://www.skillbyai.com/en/github/gh-push-clone

> 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.

```bash
git push origin main
```

## Cloning a repo

`git clone` downloads the full history of a repo and sets up `origin` automatically — ready to work immediately.

```bash
git clone https://github.com/username/my-app.git
```

**Quiz:** Which command downloads a full copy of a remote repository, including its history?

- [ ] git remote add origin
- [ ] git push
- [x] 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.
