Git for Beginners

Welcome

Version control is the first tool every developer meets and the one nobody explains. This course starts before the first command: what actually goes wrong without it, what Git is (and the three things people think it is), and a terminal you have never opened. From there you build a real history — commits that mean something, branches, a merge, a conflict resolved calmly, and every common way of undoing a mistake, including the safety net almost nobody tells beginners about. The second half puts the work where other people can see it: GitHub keys and pushes, pull requests, code review from both sides, issues, a README worth reading, and your first contribution to a stranger’s project. One running example — Sandpiper, a birdwatching club’s website — carries every command, and the last chapter is an honest map of what this book left out and where to learn it.

≈7 hours to complete Knowledge check on every topic

About This Course

Git has a strange place in a developer's education. It is the first tool you are handed and the last one anybody explains: someone says "just commit and push" on day one, and from then on you are running commands you cannot read against a program nobody has described. Most people compensate by memorizing four incantations and quietly hoping nothing goes wrong for the next two years.

This course takes the opposite route. It starts before the first command, with what actually goes wrong when you keep versions of your work in folders called site-FINAL-v2. It introduces the terminal from zero, because the register of this book assumes you have never opened one. Then it builds the model that makes Git predictable — a file is in one of three places — and everything after that is a small step from something you already understand.

To keep it concrete, the whole book builds one project. You are making Sandpiper, a small website for a neighbourhood birdwatching club, while learning to code. Its files, its accidents, and eventually its second contributor carry every example. By the last chapter Sandpiper is a public repository with a readable history, a README, a licence, and a merged pull request — which is to say, the first thing you could show someone.

Who This Is For

Someone learning to write code who has never used version control: a student, a bootcamp attendee, a career-switcher a few weeks into their first course. You have files you care about and an editor you already use. You do not need to know what a server is, you do not need any command line experience, and no prior Git of any kind is assumed.

If you already commit, branch and merge daily, this course is below you — the deep dive named at the end of it is the one to read instead.

What You Should Already Know

  • How to create, rename and open files and folders on your own computer — everyday user knowledge, nothing more
  • How to use a text editor of some kind; any one you already have is fine
  • No command line experience — an entire topic in Chapter 1 introduces the terminal from nothing
  • No HTML or programming knowledge is required to follow the examples: Git never looks inside your files, and neither does this book

How the Course Is Built

Eleven chapters, in a deliberate order. The first three build the foundation: why version control exists, your first repository and the three places a file can be, then how to read the history you are building. Chapter 4 comes next, out of the order most books use, because "I broke something and I am afraid to touch it" is the thing that actually stops beginners — so undoing gets a full chapter before branching does, and it ends with the reflog, the safety net that makes everything else survivable.

From there: ignoring the files Git should never see, then branches and merge conflicts, and at the halfway point GitHub, which is the first time anything leaves your laptop. The second half is other people — pull requests, review, issues, contributing to a stranger's project — and it closes with the habits that keep you out of trouble and an honest map of what this book did not cover.

Every topic has the same shape: the problem first, the mechanism second, a picture, the mix-ups beginners actually run into, why it matters, and a short knowledge check. Every command is one you can type at your own keyboard while reading.

Merge, never rebase
This book teaches merging and names rebase exactly once, at the end, as something the deep dive covers. A beginner who rebases shared work loses it; a beginner who merges gets an untidy graph and keeps everything.
Fear first
Undoing comes before branching, and every recovery page says plainly whether it destroys anything. The one command in the book that permanently loses work is labelled as such where it appears.
One project throughout
Sandpiper accumulates: the conflict you resolve alone in Chapter 6 comes back in Chapter 8 with someone waiting, and the file you should not have committed in Chapter 5 is still in the history in Chapter 9.
Honest about the edges
No internals, no history rewriting, no CI configuration — and a closing chapter that names every one of those omissions, says what it is, and points at where it is taught properly.

Chapter Map

Chapter 1
Why Version Control Exists
The problem before the tool: what a folder of copies cannot tell you, what Git is and is not, the project you will build, the terminal, and Git installed and told who you are.
Chapter 2
Your First Repository
A folder becomes a repository. The three places a file can be — the model everything else rests on — then staging, your first commits, reading status and diff, and messages worth reading.
Chapter 3
The History You Are Building
Reading rather than writing: the log and how to escape its pager, the four things a commit holds, finding who changed a line and why, and how much belongs in one commit.
Chapter 4
Undoing Things
Every common way of undoing something, arranged by where the change is sitting: discard, unstage, amend, revert — and the reflog, which is why a committed mistake is almost never fatal.
Chapter 5
Ignoring and Setting Aside
The files Git should never see, the awkward case where one is already committed (and what to do first if it was a secret), and the drawer for half-finished work.
Chapter 6
Branches
A branch is a label that moves. Creating and switching, merging back, resolving a conflict slowly and calmly with an escape hatch, and cleaning up when the work has landed.
Chapter 7
GitHub: Putting It Somewhere Else
The first time anything leaves your laptop: what GitHub is and is not, proving who you are without a password, your first push, cloning, and the sync loop behind week one’s most common message.
Chapter 8
Working With Other People
Theo arrives. The team loop, opening a pull request, review from both sides, merging and the two cleanup steps, and the issues where most real work starts.
Chapter 9
The Repository as a Public Place
Sandpiper goes public: the README everyone reads first, what a licence decides, your first contribution to a stranger’s project, and what your profile actually says about you.
Chapter 10
Habits That Keep You Out of Trouble
Ten chapters become a routine: a day of Git, the conventions worth adopting, the four mistakes that genuinely hurt, and one page to return to when something has gone wrong.
Chapter 11
Where To Go Next
What this book left out and where each piece is taught, the green tick you will meet on your first pull request, and a four-week plan that turns reading into a habit.

Disclaimer

This course is an independent educational project created and maintained by Sergey Okinchuk. It is provided for learning and reference purposes only.

No affiliation. This course is not affiliated with, sponsored by, endorsed by, or officially connected to the Git project, GitHub, Microsoft, or any other company, product, or organization mentioned. All opinions, interpretations, and recommendations expressed are those of the author. Sandpiper, Theo, and every scenario built around them are fictional; any resemblance to real projects or persons is coincidental.

Trademarks. Product and company names referenced — including Git, GitHub, and any other tools or services — are the property of their respective owners. Use of these names is for identification and educational purposes only and does not imply any endorsement.

Educational simplifications. This material teaches durable concepts for understanding, not operational instructions. Explanations are deliberately simplified for learning, and where a simplification could mislead, the text says so and names where the full picture lives. This course is not professional advice and is not a substitute for qualified expertise in any decision involving production systems, security, or the handling of credentials.

Accuracy and currency. Git's command set is unusually stable, but hosting services are not: GitHub's interface, its authentication requirements, and its account settings change without notice. Facts in this course reflect the author's understanding at the time of writing and may not be current. Where a detail is likely to drift — installation, authentication, and the web interface in particular — always check the official documentation.

No warranty. This material is provided "as is" without warranty of any kind. The author accepts no liability for any loss or damage arising from reliance on the content, including any loss of data or source history.