What is Git?
Git is a tool that keeps track of changes you make to your code over time.
Think of it like this
It's like the save points in a video game. Every time you reach a good spot, you save - and if things go badly later, you can reload any earlier save instead of starting over. Git even lets you try something risky in a separate save slot, without touching your main progress.
What's happening
Summary
Git records snapshots of a project over time, so you can see what changed, undo mistakes, and let many people work on the same code without overwriting each other.
A Closer Look
Git keeps a full history of a project's files, especially code. Each time you reach a point worth keeping, you make a commit - a snapshot of every file, along with a short message describing what changed and who changed it. Commits line up into a timeline, so you can compare any two versions, see exactly which line changed and why, and roll back to an earlier version if something breaks.
Git's other big idea is branches. A branch is a separate line of work - say, a new feature - that you can develop without touching the main version everyone relies on. When the work is ready, it's merged back in. This is how hundreds of developers can work on the same project at the same time without overwriting each other. Every copy of a Git project holds its full history, and teams usually share one central copy on a hosting site like GitHub or GitLab, syncing their own copies with it.
Common Misconceptions
- Git is not the same as GitHub - Git is the tool you run locally, GitHub is a website that hosts Git repositories online.
- Git isn't only for teams - solo developers use it too, to track their own history and experiment safely.
- You don't have to use the command line - there are visual apps that make Git accessible without typing commands.
How it connects
Git fits into the broader picture of how code gets built and deployed:
Try it yourself
Visit any open-source project on github.com and click the Commits tab. You're looking at a real Git history - every change ever made to that project, with dates and messages.