Git records the history of file changes
Git is a distributed version-control system. Instead of only overwriting a file, it lets you record which files changed, when they changed, and why.
Git is common in software development, but it can also track Markdown, configuration files, and other text-based work. The core history can live entirely on your computer, so Git does not require a GitHub account.
What can Git do?
- Show the difference between file versions
- Record related changes as a commit
- Inspect earlier states and individual changes
- Separate work from the main line with branches
- Combine work from several people in one project
Git and GitHub are different
Git is the system that manages history. GitHub is an online platform that hosts Git repositories and adds sharing and review features. If Git is the history book, GitHub is one place where the book can be shared.
Graphical applications such as GitHub Desktop, SourceTree, and VS Code can control Git through buttons. The underlying operations are still commits, pushes, pulls, and merges.
Important cautions
Git preserves history, but not every operation is automatically reversible. Force-pushing and rewriting shared history can affect other people’s work.
Do not commit passwords, API keys, or personal information. Deleting the secret from the latest version may not remove it from earlier history.
Git records what changed; it does not decide whether the change is correct or whether a website still works. Review the diff and run the appropriate tests before recording AI-generated or human-generated changes.