From the course: Learning GitLab

Version control - GitLab Tutorial

From the course: Learning GitLab

Version control

- [Instructor] GitLab is built on the Git Version Control System. In this chapter, we'll learn exactly what that means, and how Version Control is different from other ways of managing files. Let's take a minute to look at what life is like without Version Control. Imagine you have a document, and several colleagues are working together, say a job description for a new position you'd like to hire. Of course, you could use something like Dropbox Paper or Google Docs and collaborate in real time. But let's say your corporate IT department is particularly draconian and blocks those sites. So, you write out a list of qualifications and attach a file called jobdescription.doc to an email, and send it to the team asking for their comments. Meanwhile, Karen has written a list too, about half of which overlaps with your list, and she emails a file called openposition.doc to the team. So, when you see her email, you reply that you'll combine them into one doc. Meanwhile, Steve is also working on a doc, job.doc that's mostly overlapping with the other two, and he emails that to the team after you've sent your revised jobdescription_v2.doc out to the whole thread. So, Karen volunteers to combine them this time, but she didn't see your revised version, so now she just has her list and Steve's in a document called openposition-combined.doc, but she also decided that she didn't like some of Steve's list, so she didn't include it. There are now five separate documents on the email thread with various overlap. So, how does this situation get resolved? Generally, the entire team schedules a meeting to actually do the work of writing the job description in real time, face to face. Sounds terrible, right? Now, imagine instead of developing a single job description between three people, you were developing a complex software application with tens or hundreds of thousands of lines of code and a team of 50 developers. It just isn't possible without some kind of system, either a strict set of rules or a piece of software. Let's go back to our job description document for a second. With GitLab, you can work on your list directly on the server in your own copy of the project, which is known as a branch in Git. Once you're satisfied with your changes, you can merge them into the main document. Once Karen is ready with her list, she'll merge it into the main document. Depending on the changes, she might be prompted at that point to fix conflicts line by line. For example, if you both started with the same document and edited the same line, one of you would need to manually decide which version to use, or write a new version that combined all the changes. Finally, when Steve is done, he'll be able to see everyone's list, and he can see the parts of his own changes that he needs to change or remove. I want to emphasize that there's no magic here. Collaborating still requires manual work of figuring out how to combine the documents, but Git forces that to happen in a structured way, and makes it easy to see what other people are doing.

Contents