Git/GitHub Introduction — Understanding Version Control

After coding for a while, two situations come up: "I want to go back to yesterday's version" and "I want to write code together with a friend." That's when you need Git and GitHub. They let you keep a history of your code and collaborate easily. Getting comfortable with them as a teen gives you something concrete to talk about when exploring future opportunities.

What Is Git?

Git is a version control tool developed in 2005 by Linus Torvalds—the same person who created Linux. It records "when, who, and what changed," so you can always look back at earlier states if something goes wrong. Think of it as "Word's track changes + organized Ctrl+Z for your code."

What Is GitHub?

GitHub is a service that stores your Git history online. It's like a "code sharing space" where you can publish your projects, collaborate with friends, or contribute to open-source projects from around the world. Age requirements and terms of use can change, so check the official guidelines when creating an account.

How It Works: Connecting Your PC to the World

With Git history, you can see "when, who, and what changed" An example of history displayed by the git log command $ git log --oneline a3f2c1d Timer app: add sound when time is up yuki, 5 minutes ago b8e9f02 Bug fix: timer not stopping at 0 yuki, 30 minutes ago 5d4c2b1 Make button larger for easier tapping on mobile yuki, yesterday 9a7b3e4 Add start button, color it green with CSS yuki, 3 days ago 2c8d1f7 Timer app first version (5 lines, HTML + JS) yuki, 1 week ago eaa9c5b Add README.md yuki, 1 week ago ▶ "What was that bug fix last week?" → git log shows everything. You can revert to any point.
Fig 1: A real Git history log. "What, when, and why it changed" is all recorded, and you can return to any past state.

Git is "the tool that creates history on your own PC." GitHub is "the place that stores that history in the cloud." The flow is: push sends from your PC to GitHub, pull brings from GitHub to your PC.

The 3 Core Commands

3 core commands: what you type → what happens "Select changes → commit to history → send to cloud" — just remember this flow ① git add — stage your changes as candidates to record $ git add index.html → index.html is staged (not yet in history) ② git commit — finalize staged changes as a history entry (message required) $ git commit -m "Change button color to green" → Saved as history entry a3f2c1d. Can revert to this state later. ③ git push — send history to the cloud (GitHub) $ git push origin main → History is now copied to GitHub. Accessible from any other PC. Frequency: "whenever a chunk of changes is done" (1–10 times a day)
Fig 2: The 3 core commands with real examples. These three are enough to start. Branch and merge come later once you're comfortable.

Memorizing add → commit → push is all you need to start basic version control. Once you're comfortable, you can explore branches and merging, but start by making the flow "select, record, send" feel natural in your hands.

What You Can Do with GitHub

Keeping your code on GitHub means you can share public repositories via a URL. This can serve as a portfolio when applying for schools or jobs. Don't just publish the finished product—write a README explaining "what you built," "how to run it," and "what you focused on," and it becomes much easier for others to understand.

You can also report bugs in open-source projects or submit your own fixes. You don't need to jump into a huge project right away. Publishing a small project, writing a README, and making a few commits is already great practice.

Common Pitfalls

Three traps with Git/GitHub
  • Pushing passwords or API keys that are hardcoded in your source. Once public, they're hard to remove from history. Use .gitignore.
  • Writing vague commit messages like "fix" or "update." Your future self will be confused. Write something specific like "Fix bug causing score to reset on reload."
  • Being afraid to commit and saving files by copy-pasting instead. That's not version control. Even once a day is fine—make committing a habit.

How Will This Help Later?

In IT companies and developer communities, showing your GitHub account and project URLs is common. A GitHub account you've used consistently since you were a student becomes a record of your learning. Since working engineers use these tools every day, getting comfortable with them as a teen means you'll understand collaborative development thinking early.

What You Can Do Today

Start with 3 steps
  1. Create an account on GitHub (free; check age requirements with a parent/guardian).
  2. Create one repository that contains only a "README.md" and write a short intro about yourself.
  3. Edit the README directly in the GitHub browser interface and make a commit (no command line needed at first).

Summary

Git is a tool for keeping a history of your code. GitHub is the place to share that history in the cloud. Getting comfortable with these as a teen gives you a record of your projects and a way to practice collaborative development. Start with the three commands—add → commit → push—write a README, and put your work into a form you can explain to others.