Learn Git Basics in 10 Minutes
Introduction to the core concepts of Git, one of the most common source code management systems.
Git is a free and open source distributed version control system. It’s incredibly powerful and prevalent in the IT industry, meaning that having at least a basic understanding of Git is crucial for most tech roles.
The core concepts are best explained via a series of practical examples, which we will flesh out to increase your overall understanding. By the end of this 10-minute read you should have picked up the basics of Git.
Getting Started — Install and Configure
Installers are available for most platforms via https://git-scm.com/.
Once installed, head to your console of choice and type
git --version to verify all is working.
Next step is to do some basic configuration. You should initially configure your user information that will be used to identity any changes you make.
git config --global user.name "firstname lastname"
git config --global user.email "firstname.lastname@example.org"
Now you’re ready to get going!
To learn the fundamentals of Git workflows, there are four main stores to understand (you may hear of a fifth — “stash” — but that’s beyond the scope of this basic introduction).
- Staging Area
- Local Repository
- Remote Repository (optional)
As the name suggests, the Workspace or Working Directory is the view of the directories and files that you are actively editing. These are the versions you will be able to see by navigating to the directory using File Explorer and when opening a file in your favourite editor.