# Pushing & Cloning — GitHub

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

> Send commits to GitHub, and get a full copy of a repo onto a new machine.

## 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
- [x] git clone
- [ ] git push

*Answer:* git clone. `git clone` copies the entire repository, while `git remote add` only links an existing local repo to a URL.
