The Importance of Source Control!

The latest and greatest pieces of software have all sorts of intricate components that are written by thousands upon thousands of developers, which can bring the project size to staggering heights.

So how are developers supposed to manage a behemoth-size project?

Well, this is exactly where source control comes into play.

Briefing on Source Control

If I were to put “Source Control” into Laymen’s terms, I’d describe it as a means of tracking and distributing changes to a project.

A professor also once told me that source control is simply a means of taking snapshots of a project at milestones.

Further, source control can just be thought of, as a way of inhibiting users to manage their projects, albeit small or large.

Git

Now, it’s important to note that not all pieces of source control software do the same things. Some may do things that others just aren’t capable of, and vice versa.

To ensure that we’re all on the same page throughout the rest of this post, we’ll be talking about Git.

P.S. I’ve chosen Git because it’s the most popular piece of source control software in the world at the time of the writing.

What is Git?

As described by the official Git website, they describe Git as:

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Basically Git is just another source control piece of software that is capable of efficiently managing your project.

Why do we Need it?

Have you ever heard of Linux?

If not, let’s just consider it as a very big coding project that has millions upon millions lines of code.

The Linux Developers weren’t using a very good set of tools that helped with source control at the time, and due to events surrounding these tools, they were forced to develop their own.

This is why Git was birthed. Basically to track, distribute, and offer revision histories of the Linux project.

Git Further Explained…

If you still haven’t grasped what Git does, and it’s importance… I’ve broken it down into the simplest explanation I possibly could right below.

So, for the sake of this explanation, let’s say that we’re working on an English project that will be due in 3 days time. and let’s also say that we write a draft the first night, and then expand on it each night until it’s due.

1st Night: At the start of the first night, we tell Git to start tracking our English paper, and we begin writing our first draft. At the end of the night, we tell Git that our first draft is done.

2nd Night: At the start of the second night, we are really tired, but we trudge along writing our second draft. Again, at the end of the night we tell Git that our second draft is now done.

3rd Night: Finally, we start working on our final draft, until we realize that our second draft is horribly wrong and we need to revert to our 1st draft. Easy, we tell Git to simply revert our changes to the first draft, and we start writing again.

As you can see, Git saved our paper, because it allowed us to go back to that working version.

Just as it would allow the Linux developers, or any other “git-user” to revert to a working snapshot of the code or project.

What are the Advantages and Disadvantages?

Before I begin listing off the advantages and disadvantages of using source control in your project, let me just say that using source control will always outweigh the benefits of not using it.

But, also like everything else we know, there are always associated advantages and disadvantages.

Anyways, here is my list of the advantages and disadvantages of using source control:

Advantages:

  • Tracks all changes made to a project
  • Creates a version history, that allows you to revert to different milestones
  • Allows for easy distribution of the project
  • Allows simultaneous versions of the project to exist at any given point
  • A lot of major projects use some sort of source control these days

Disadvantages:

  • Takes time to get used to using source control
  • Can be slow if you have a slow network-connection
  • Takes up slightly more space than the project would by itself

Common Misconceptions about Git

Traveling through my everyday life, I hear a lot of misconceptions regarding Git.

It’s all too common to hear people mention things like how Git depends on GitHub to function. Or even just aliasing Git’s functionality to GitHub. To clear the air, GitHub employs Git under the hood to manage any repositories you may have, not the other way around.

It’s also not out of the ordinary to hear that Git can’t operate independently of GitHub, or it at least needs a server to operate correctly. This is also incorrect, as Git is described as being “decentralized,” or requires no centralized source to function.

Basically, you can run track, save, and push your code all on the same computer.

Real Life Examples of Source Control

Moreover, Source control is just a fancy way of talking about a piece of software that tracks, and distributes changes in a project.

In the example provided earlier, we talked about writing an English project using source control. Although this doesn’t seem too realistic for kids to be doing in 2019, this is because we have an even easier way of accessing source control.

Google Docs. Yes, Google Docs is basically its own form of source control, that employs its own methods of allowing the user to take their “snapshots” of their project.

Source control is a whole lot more popular than you think, just take it from these companies that employ Git in their everyday work-cycles:

Linux-logo

  • Google
  • Android
  • Twitter
  • Microsoft
  • Linux
  • PostgreSQL
  • Netflix
  • Linkedin
  • Facebook

Other Cool Features of Git

Git is not only used to take “snapshots” of a project during its milestones, but it also has some really cool less-known features it possesses:

git blame –> Git has a really cool features called blame, what this allows you to do is see who made what changes to a given line of code. This is very useful if you’re trying to hunt down somebody who created a bug, or if you simply just want to find out more information about the code they wrote.

git config –> Git is extremely customizable using the config parameter. For example: you can literally modify the way that Git lists pending files.

Consider Supporting the Blog!

Thanks for reading this post, I really hope you enjoyed it.

If you enjoyed it a little too much, please feel free to leave a comment below, and support me on Patreon here!

Sources used in this post: Git-scm

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*

*