Clone
The project that lost its past
Alice bought a new laptop and wanted to keep working on her bakery's order site. She opened the project on GitHub, pressed the green Download ZIP button and unzipped it on the new machine. It ran, and she carried on. A week later she wanted last month's menu page back and asked the AI to find it. The AI reported that this folder had no history at all and no connection to GitHub. The download had carried the files and left everything else behind.
- Clone copies a repository from GitHub with its full history.
- A clone remembers where it came from, so sending changes back needs no setup.
- Download ZIP and copied folders bring the files only, without history or the link.
- Only the public .pub key goes to GitHub; the private key never leaves your computer.
Download ZIP is not a Clone
Dos and don'ts
- Create the repository on GitHub, then clone it.
- Clone once on each computer you work on.
- Move projects between computers by copying folders.
- Paste a private key into an AI chat.
Start on GitHub, then clone
When you want GitHub: create a free account (no card needed), click New repository, choose Private and create it. GitHub shows an address ending in .git. In a terminal, in the folder where you keep your projects, git clone with that address makes a new folder with the project inside. It's a repository already, and it remembers GitHub under the name origin.
A copy isn't a clone
GitHub's Download ZIP button, and copying folders between computers, bring the files only. The history and the link to GitHub stay behind. Clone once on each computer you work on; the next topics move changes between the copies.
Proving it's you
Ask the AI to install GitHub's gh tool and run gh auth login. That's the easiest way to prove who you are, for a private repository and for every push after. Example: HTTPS clone opens a browser login; SSH needs a key in ~/.ssh added on GitHub before git clone git@github.com:….
On Windows, Git can also open a browser to sign in. On a Mac it may ask for a personal access token, a long code you create on GitHub, because GitHub no longer accepts your account password there.
If you use SSH instead, only the public key goes to GitHub. That's the file ending in .pub, under Settings, SSH and GPG keys, New SSH key. The private key stays on your computer. Never paste it into a chat.
If you see Permission denied (publickey), ask the AI to check three things, one at a time: does a key exist, is it loaded, and does the project use an SSH address.
Clone my GitHub repository into my projects folder on this computer. Show me the command before you run it. Then run git status and git remote -v. Explain in one sentence what each tells me.
Dos and don'ts
copy my project folder to the new laptop
Clone my repository from GitHub on this laptop, then show me git log and git remote -v so I can see the history and the link came along.
Example
Clone my project from GitHub onto this computer, then show me the last five commits and the remote address, so I can see the history and the link to GitHub came along.
Paste into your agent inside a project folder. Prompts that say "this project" are for the app you build in the Lab, or any app you already have. No project yet? Read them now and paste them later, in the Lab.
Give me the exact clone command for this repository address, run it after I say yes, and show me how to confirm the history came along.
Set up an SSH key for GitHub on this computer. Explain each command before you run it and show me exactly which file to paste into GitHub. Never print my private key.
Explain the difference between GitHub's Download ZIP button and git clone, using this project as the example.
Watch
Clone = make a full local copy of a shared repository.