Uploading to GitHub
Uploading to GitHub
GitHub is where your work files are saved in order over time. Today you will copy (fork) the instructor's repository into your own account, work inside it, and record a snapshot each time you make changes. Once forked, the repository is yours, so everyone develops in their own fork.
A few terms
- Repository: one project folder.
- Fork: copying someone else's repository, all of it, into your account. After that it is yours and you can change it freely.
- Clone: downloading your repository to your computer.
- Commit: a "saved up to here" stamp. It comes with a one-line message.
- Push: uploading the commits on your computer to GitHub.
1. Fork
- Open github.com/joonhyungbae/opencircuit.
- Click the Fork button at the top right.
- Change the Repository name to your own, for example
sohee-opencircuitortide-machine. Letters, numbers and hyphens are safest. - Click Create fork.
You are done when https://github.com/your-username/your-repo-name exists. This repository is now yours.
2. Download to your computer (clone)
Use Clone Repo on Cursor's start screen, or in the terminal (Ctrl/⌘+`):
cd ~/Documents
git clone https://github.com/your-username/your-repo-name.git
On Windows, instead of cd ~/Documents you can open your Documents folder in File Explorer and then open that folder in Cursor.
Open the downloaded folder in Cursor. All of today's work happens inside this folder.
3. Tell Git your name (first time only)
Each commit records who made it. Run this in the terminal once:
git config --global user.name "Your Name"
git config --global user.email "the email you used for GitHub"
4. Make your own file
Ask the Cursor chat (Ctrl/⌘+L). Have it make the file at the top of the folder (the root), so that your Pages address opens it directly later.
Make index.html at the top of the folder. It's a page with my name and one line about what I'm making today.
5. Commit and push
Click the Source Control icon (the branch shape) on the left in Cursor → write a one-line message and click ✓ → Sync. If you would rather avoid the terminal, this is all you need.
To do it in the terminal:
git add .
git commit -m "one line about what you changed"
git push
Refresh your GitHub page. If you see the index.html you just made, it worked. You have now reached the minimum goal (one push).
If you get confused: three folders
| Where | What | Do I edit it? |
|---|---|---|
Hidden .opencircuit in your home folder | Tools installation (updates automatically) | ❌ |
| Your fork in the Documents folder | Where you work today | ✅ |
OpenCircuit in the Documents folder | The artwork folder read by the gallery | Later sessions |
Publish on the web (optional)
In your repository, go to Settings → Pages → Branch: main / (root) → Save. After 1 to 2 minutes, the page you made opens at https://your-username.github.io/your-repo-name/. From the next session on, you will use this address to show each other what you have made.
When the original is updated (later sessions)
When tools are added to the instructor's repository, they do not arrive in your fork automatically. Click Sync fork → Update branch at the top of your repository to bring them in. You do not need to do this today.