Introduction
Git is like a really epic save button for your files and directories. Officially, Git is a version control system.
A save in a text editor records all of the words in a document as a single file. You are only ever given one record of the file, such as essay.doc
, unless you make duplicate copies (which is difficult to remember to do and keep track of):
essay-draft1.doc
, essay-draft2.doc
, essay-final.doc
However, a save in Git records differences in the files and folders AND keeps a historical record of each save. This feature is a game changer. As an individual developer, Git enables you to review how your project grows and to easily look at or restore file states from the past. Once connected to a network, Git allows you to push your project to GitHub or other alternatives such as: Bitbucket, Beanstalk, or GitLab for sharing and collaborating with other developers.
Please note, we only support GitHub within our curriculum, and will not help troubleshoot the alternatives.
While Git works on your local machine, GitHub is a remote storage facility on the web for all your coding projects. This means that by learning Git, you will get to showcase your portfolio on GitHub! This is really important because almost all software development companies consider using Git to be an essential skill for modern web developers. Having a GitHub portfolio will provide proof to future potential employers as to what you are capable of.
In this lesson, we will briefly explore the history of Git, what it is, and what it’s useful for.
In the next lesson, we will go over the basic workflow for using Git, which should enhance your understanding and demonstrate why Git is so useful.
Finally, you will set up a project with Git that will serve as a template for your future projects.
For now, let’s learn what Git is and why it’s so powerful!
Lesson overview
This section contains a general overview of topics that you will learn in this lesson.
- Explain what Git and GitHub are and the differences between the two.
- Describe the differences between Git and a text editor in terms of what they save and their record keeping.
- Describe why Git is useful for an individual developer and a team of developers.
Assignment
- Read chapters 1.1 through 1.4 from the Getting Started section of Pro Git to learn the differences between local, centralized, and distributed version control systems.
- Watch “What is Git?” explained in 2 minutes - a video about what Git is and how it can improve the workflow of both an individual and a team of developers.
- Read “About GitHub and Git” for a brief introduction of what GitHub is and how Git and GitHub work together. You can skip the “Where do I start?” section at the end.
- If you haven’t yet installed Git, visit the Setting Up Git lesson.
- Take a look at The Odin Project’s GitHub repository. This is where all the lessons are stored! While you’re there, look at all our contributors to gain an appreciation for how Git records all collaborative efforts and how GitHub visually represents this.
Knowledge check
The following questions are an opportunity to reflect on key topics in this lesson. If you can’t answer a question, click on it to review the material, but keep in mind you are not expected to memorize or master this knowledge.
- What kind of program is Git?
- What are the differences between Git and a text editor in terms of what they save and their record keeping?
- Does Git work at a local or remote level?
- Does GitHub work at a local or remote level?
- Why is Git useful for developers?
- Why are Git and GitHub useful for a team of developers?
Additional resources
This section contains helpful links to related content. It isn’t required, so consider it supplemental.