All blogs

Git & GitHub Without the Fear: A Practical Starter

Commits, branches and pull requests explained in plain words, with the handful of commands you will use every day.

1 min read

Git has a reputation for being confusing, but day to day you only need a small set of ideas and commands. This guide covers exactly those, nothing more.

Git and GitHub are not the same thing

Git is a tool that runs on your computer and remembers every version of your project. GitHub is a website that stores a copy of that history online, so you can back it up, share it and work on it with other people.

The three ideas that matter

  • Commit: a saved snapshot of your project, with a short message describing what changed.
  • Branch: a separate line of work, so you can try something without touching the main version.
  • Pull request: a proposal on GitHub to merge one branch into another, with space for review.

The everyday commands

git status                 # what changed?
git add .                  # stage every change
git commit -m "Add footer" # save a snapshot
git switch -c new-header   # create and move to a new branch
git push -u origin new-header

That is genuinely most of what you will type in a normal week.

A simple workflow

  1. Create a branch for every feature or fix.
  2. Commit early and often, with clear messages.
  3. Push the branch and open a pull request.
  4. Review, merge, and delete the branch.

When things go wrong

Made a mess you have not committed yet? git restore . throws away your local changes. Committed something by mistake? git revert creates a new commit that undoes it, without rewriting history. Both are safe, and knowing they exist takes most of the fear away.

“Programs must be written for people to read, and only incidentally for machines to execute.”
— Harold Abelson
Made with Modulify