Git and GitHub course menu
What Is Git? Version Control Explained for Beginners
What Git and version control are, why every developer uses them, the difference between Git and GitHub, what a repository and a commit are, and how this course works.
On this page
Git is a version control system: a tool that records every change you make to a project, so you can see what changed, go back to any earlier version, and work with other people on the same files without overwriting each other's work.
Nearly every software team uses it. Knowing Git is expected for almost any developer, data or DevOps job, and your GitHub profile often counts as part of your portfolio.
The problem Git solves#
Without version control, projects tend to look like this:
report.docx
report_final.docx
report_final_v2.docx
report_final_v2_REALLY_FINAL.docxYou cannot tell what changed between the files, and if two people edit a copy at the same time, someone has to combine them by hand.
With Git there is one folder of files, plus a complete history of every saved version, who made it, when, and why. Going back is one command.
Key words#
History in Git is a chain of commits, each pointing back to the one before it. The newest commit on the current branch is called HEAD:
A <--- B <--- C <--- D main (HEAD)Git is not GitHub#
These two are often confused:
You can use Git without GitHub. GitLab and Bitbucket are alternatives to GitHub, and all of them store ordinary Git repositories.
Why Git is called distributed#
In older systems, the history lived on one central server. In Git, every copy of a repository contains the full history. You can commit, browse old versions and create branches with no network connection, and if a server is lost, any clone can restore the project.
How this course works#
You will type commands in a terminal, mostly in a small practice project. Every Git command that shows output in this course was run while writing it, and the output below it is the real result. Steps that happen on the GitHub website are described instead. Commit IDs such as a3f1c2d are calculated from a commit's content, author and time, so the IDs on your computer will be different from ours. Everything else should match.
Key takeaway#
Finished this lesson?