Git is a distributed version control system that tracks changes to files over time, letting multiple people work on the same codebase without overwriting each other's work. Created by Linus Torvalds in 2005 to manage the Linux kernel, Git is now the standard tool for source code management in nearly every software project. It runs locally on your machine and stores a complete history of every change ever made, so you can go back to any previous state of your project at any time.
The basic workflow goes like this. You make changes to files in your working directory. You stage the changes you want to save using "git add." You commit those staged changes with "git commit," which creates a permanent snapshot with a message describing what you changed and why. Each commit gets a unique hash (like a3f2b7c) that identifies it. You can view the full history with "git log," compare any two versions with "git diff," and revert to a previous commit if something goes wrong.
Branching is where Git gets powerful. A branch is a separate line of development. You create a new branch with "git branch feature-x" and switch to it with "git checkout feature-x." Now you can make changes without affecting the main codebase. When your feature is ready, you merge it back into the main branch. If two people edited the same lines, Git flags a merge conflict and asks you to resolve it manually. This branching model lets teams work on many features in parallel without stepping on each other.
Git is distributed, meaning every developer has a full copy of the repository, including all the history. You do not need a network connection to commit, view history, or create branches. Platforms like GitHub, GitLab, and Bitbucket host remote copies of repositories and add collaboration features like pull requests, code reviews, and issue tracking on top of Git. But Git itself is just a command-line tool. Learning a handful of commands (clone, add, commit, push, pull, branch, merge) covers 95% of daily use.