Start With the Problem#
You and two friends are building StudyBuddy. Without any tools, this happens:
Your folder fills up with
quiz_final.py,quiz_final_v2.py,quiz_final_v2_REALLY_FINAL.py. Which one is live?Rahul and you both edit
quiz.pyon the same day and email your copies. Whose changes win? Someone's work is silently lost.Scores started coming out wrong sometime last week. Which change broke it, and who made it, and why?
You try a risky redesign. It fails. How do you get back to exactly how things were on Tuesday?
Your laptop is stolen. Is the code gone?
Every software team on Earth solves these five problems the same way: with Git.
The Plain Picture#
A photo album of your project. Every time you reach a good point, you take a photo of every file, and write a caption: "Added quiz scoring." You can flip back to any photo, compare two photos, and see exactly what changed between them. Friends can take their own photos and combine albums.
The Real Names#
A version control system (VCS) records changes to files over time so you can recall any version.
Git is by far the most used VCS. It was written by Linus Torvalds in 2005 to manage the Linux kernel.
Git is distributed: every developer has the full history on their own machine, not just the latest files. You can commit, branch and browse history with no internet, and every copy is a complete backup (Part 0's problem 5).
GitHub, GitLab and Bitbucket are websites that host Git repositories and add collaboration features (pull requests, reviews, issue tracking, CI — CI/CD (coming soon)). Git ≠ GitHub: Git is the tool; GitHub is a service built around it.
Check yourself
2 questionsWhat does "distributed" mean for Git?
Show answerHide answer
Every copy of the repository has the complete history, so most operations work offline and every copy is a backup.
What's the difference between Git and GitHub?
Show answerHide answer
Git is the version control tool; GitHub is a hosting and collaboration service for Git repositories.