• 6 hours
  • Easy

Free online content available in this course.

course.header.alt.is_video

course.header.alt.is_certifying

Got it!

Last updated on 6/7/23

Discover the Magic of Version Control

In this course, I’m going to introduce you to the tool every good developer needs: a version control system.

Imagine this: you’ve spent a week writing your code, and you’ve produced your first version, V1. Your colleague makes some suggestions to improve it, so you create a second version of your code, V2. To keep track of your project’s history and prevent unpleasant surprises (bugs or losing your work), you’ll need a version control system.

Version control
Version control

What Is a Version Control System?

So, what is a version control system?

A version control system helps you keep track of:

  • All changes to each file.

  • Why these changes were made.

  • And who made them!

If you’re working on your own, it makes it easy to keep a record of your changes or go back to a previous version. 

If you’re working on a team, you won’t need to rely on your detective skills anymore! A version control system combines the changes made by people working together on the same file. This means that you no longer have to worry about your work being deleted by mistake! 

In this course, you’ll learn to use the Git version control system.

It’s a program with a decentralized structure.

What does that mean?

With Git, the full code history is not stored in the same place. Instead, each time a copy is made of the code, a new repository is created, which contains all of the changes.

Why Is This Useful for Teamwork?

Let’s take a practical example. Alice and Bob have been working together on the same project for a month. Everything was going fine until yesterday when the client asked them to deliver their project urgently. Alice quickly made some last-minute changes, saved the files, and sent it to the client.

The next day, the very annoyed client called to complain that nothing was working. Alice and Bob couldn't understand it—they had divided up the tasks clearly, and each of them had done their work correctly.

So, where did the problem come from? Well, without realizing it, Alice overwrote Bob’s code when she made the final changes. Bob hadn’t made a local copy of his work, so he couldn’t restore his work—which meant that all the work he did over the past month was lost!

Alice and Bob could have prevented all of this by using a version control system.

If they had used Git for their project, they could have made changes to the files and sent and received updates at any time, and all without the risk of overwriting the other’s changes. The last-minute changes would therefore have had no impact on the final product!

Alice and Bob have started using Git. They each work on their part of the code. When they combine them, their previous versions are archived.
Alice and Bob have started using Git. They each work on their part of the code. When they combine them, their previous versions are archived.

Git or GitHub? What’s the Difference?

If that seems a bit confusing, don’t worry! The following example should make it clearer. 

Imagine you’re helping to create a perfume. First, you make the base for the perfume at home by mixing different ingredients; then you send it to a warehouse for storage. This perfume base can be marketed as it is or changed by adding other ingredients.

Git and GitHub follow the same principle. Git is the perfume base you made at home, and GitHub is the warehouse where other people can change or market it. 

Git helps you prepare your code. GitHub helps you store your code.
Git helps you prepare and store your code.

Let’s Recap!

  • A version control system allows developers to keep a record of file versions and the changes made to them.

  • Git is a version control system, while GitHub is an online service that hosts Git repositories. This is known as a remote repository.

Let’s move on to the next chapter to find out more about the difference between local and remote repositories!

Ever considered an OpenClassrooms diploma?
  • Up to 100% of your training program funded
  • Flexible start date
  • Career-focused projects
  • Individual mentoring
Find the training program and funding option that suits you best
Example of certificate of achievement
Example of certificate of achievement