← Back to list

A Pragmatic Guide to Git and GitHub for Humans

How to Stop Deleting Your Code

Agneya Pathare · 2026-04-13 05:11 · 0 claps · 4.2 min read
#git #github #version-control #open-source #hacktoberfest
Open on Medium ↗
Wiki topics: RAG · RAG & Retrieval 🔓 · Open Source

A Pragmatic Guide to Git and GitHub for Humans

How to Stop Deleting Your Code

I still remember my first Hacktoberfest. I was sitting in a cramped room, fueled by way too much caffeine, trying to contribute to an open-source project to win a free t-shirt. I had no idea what I was doing. I thought “version control” meant saving script_v1.py, script_v2_final.py, and script_v2_final_FINAL_FOR_REAL.py.

Then I accidentally deleted a critical function, realized my “final” version was actually three versions behind, and spent four hours staring at a blank cursor.

If you are building a startup, a side project, or just trying to survive a coding bootcamp, you cannot afford to manage code like a digital hoarder. You need Git. Not because it’s “best practice,” but because it’s the only thing standing between you and a total mental breakdown when your “simple fix” breaks the entire production environment at 2 AM.

The Bottom Line (TL;DR)

  • Git is the tool on your computer that tracks changes (the “undo” button for your life).
  • GitHub is the cloud where you store those changes so you can collaborate and show off.
  • The Workflow: Write code → git add (stage) → git commit (save snapshot) → git push (upload to GitHub).
  • Why care? It allows you to experiment without fear, collaborate without emailing ZIP files, and contribute to the global open-source community.

What is Version Control and why do I need it?

Think of Version Control Systems (VCS) like a video game save point.

Before you try to fight the “Final Boss” (like refactoring your entire database logic), you create a save point. If you get absolutely wrecked, you don’t start the whole game over; you just reload from the last save.

Git is the industry standard for this. It tracks every single character change in your files. If you realize that the code you wrote last Tuesday was actually better than what you wrote today, Git lets you travel back in time.

What is the difference between Git and GitHub?

This is the most common point of confusion.

  • Git is the engine. It’s a command-line tool that lives locally on your machine. You don’t even need internet to use Git.
  • GitHub is the parking garage. It’s a website (owned by Microsoft) that hosts your Git repositories (projects) in the cloud.

You use Git to manage your code, and you use GitHub to share it, back it up, and work with others. There are alternatives to GitHub (like GitLab or Bitbucket), but GitHub is where the party is — especially for things like Hacktoberfest and Open Source.

How to use GitHub: The “I just want it to work” Guide

I’m not going to give you a 400-page manual. As a founder, I only care about the 20% of commands that do 80% of the work.

1. Initialize your project

First, tell Git to start watching your folder. Open your terminal in your project directory and type:

git init

This creates a hidden .git folder. Don't touch it. It’s the brain of your operations.

2. The “Stage and Save” Loop

Whenever you finish a feature or fix a bug, you run this three-step dance:

Step A: See what changed

git status

This shows you which files you’ve messed with. Red means “not saved,” Green means “ready to save.”

Step B: Stage the changes

git add .

The dot . means "add everything." You are putting your changes into a "staging area"—basically, you're lining them up for the photo.

Step C: Commit (The Save Point)

git commit -m "Fixed the login bug that was haunting my dreams"

The -m stands for message. Be descriptive. "Update" is a terrible message. "Fixed bug" is okay. "I have no idea why this works" is honest, but unprofessional.

3. Pushing to GitHub

Once you’ve saved locally, you need to send it to the cloud.

git push origin main

This sends your “save points” to the “main” branch on GitHub (usually named origin).

How do I contribute to Open Source (Hacktoberfest style)?

If you want to contribute to someone else’s project, you don’t just start typing in their repo. You follow the Fork and Pull model.

  • Fork: Click the “Fork” button on their GitHub page. This creates a personal copy of their project under your account.
  • Clone: Download your fork to your computer: git clone [URL].
  • Branch: Create a new “branch” so you don’t mess up the main code: git checkout -b my-new-feature.
  • Push: Do your work, commit it, and push it to your fork.
  • Pull Request (PR): Go to the original creator’s GitHub page. You’ll see a button saying “Compare & pull request.” This is you saying, “Hey, I improved your code, please take a look!”

The “Gotchas”: What happens when things break?

Even after months of building Neuronetic Vision, I still hit Git snags. Here are the two biggest ones for beginners:

The “Merge Conflict” Nightmare

This happens when you and a teammate change the same line of the same file at the same time. Git gets confused and says, “I don’t know whose version to keep.”

  • The Fix: Open the file. You’ll see weird markers like <<<<<<< HEAD. Delete the version you don't want, remove the markers, save the file, and commit again. It’s annoying, but it’s better than overwriting your partner's work.

The “I committed a password” Panic

We’ve all been there. You commit a .env file containing your AWS keys or database password.

  • The Fix: Simply deleting it and committing again doesn’t work because it’s still in the history! You have to use tools like BFG Repo-Cleaner or git filter-branch.
  • Pro Tip: Use a .gitignore file from Day 1. It tells Git: "Never look at these files."

Final Thoughts: Just Start Shipping

Don’t wait until you’re a “senior dev” to use Git. Start today. Even if you’re just building a basic HTML site, track it. Learning Git is like learning to drive a manual car it’s clunky at first, you’ll stall a few times, but eventually, it becomes muscle memory.

Open source isn’t just about code; it’s about the community. My first Hacktoberfest taught me more about collaboration than any textbook ever could.

What’s next? Go to GitHub, find a small project with “good first issue” tags, and send your first PR. Worst case? It gets rejected. Best case? You’re officially a contributor to the global tech ecosystem.


메타데이터
post_id
7bb7804822d2
slug
a-pragmatic-guide-to-git-and-github-for-humans-7bb7804822d2
url
https://medium.com/@agneya/a-pragmatic-guide-to-git-and-github-for-humans-7bb7804822d2
canonical_url
https://medium.com/@agneya/a-pragmatic-guide-to-git-and-github-for-humans-7bb7804822d2
author_url
https://medium.com/@agneya
status
ok
fetched_at
2026-06-10 21:21:38