What is Git?
You may have seen Git included in various lists of technologies. Is Git a programming language, a framework, or something else entirely? And is Git the same thing as Github (whatever that is)?
While this post will not serve as a Git tutorial, it will explain what Git is on a high level.
In one sentence: Git is command-line-based software that manages version control. Let's explain what on Earth that means:
Let's say you're a graphic designer creating a new logo for a client. You've already worked with the client to determine the basic direction for the logo, so you send over an image for them to examine.
Naturally, they ask for certain revisions. Perhaps they want a darker shade of red, and the Q to be a few pixels taller. You go ahead and create the new version. Now, what would you do with the old version? Would you delete it from your computer? After all, the newer version is more likely to be what the client wants, and you don't really have any need for the older version anymore.
If you're wise, you'd keep the old version around. Why? Well, maybe the client will see the new version and decide they liked the original better. You don't want to have to recreate the original version, right?
So, instead of modifying the image in place, you'll make a copy. You'll call the original image something like A.png and the second version B.png. You'll keep both around in your project folder so you have easy access to both.
Now, let's say that the client likes version B better, but they want a few more changes. Perhaps they want to use a bolder font and the addition of a small image of a penguin. So, you'd create a third version - C.png - and send it to the client, while keep versions A and B handy just in case.
This is the concept of version control. Version control is having some sort of system that allows you to keep track of every version of a project, and have each version at the ready just in case. In this example, the version control system is simple: For each version, you generate a new file and keep it handy.
Of course, by the time you'll have completed the logo, you may end up with many revisions, and therefore many image files.
When it comes to software development, you'll quickly find that you want to keep track of all the versions of your code. Perhaps some recent code you've added caused a new bug, and you want to revert to the old code. Or perhaps you remember that you deleted some past code that would be really useful now, and you want to bring it back.
Now, one way you can implement version control for your codebase would be to make a copy of all your files each time you add something new. That is, before you start a day's work, you make a copy of the entire codebase (including all the folders and files), rename the parent folder to something like Version_26, and then jump into writing some new code.
As you can imagine, this can get unwieldy very quickly. Having 26 versions of a logo is one thing, but having 26 versions of a codebase will take up a lot of space on your computer! Even worse, if you actually need to find some code in an old version, it would be extremely tedious to hunt for it in 26 codebases.
Enter Git. Git is a version control system, but it's actually a piece of software that does all the version tracking automatically. So, you don't have to copy and paste any files to create new versions! Additionally, Git doesn't even keep multiple copies under the hood. How Git actually works is beyond the scope of this post, so for now, just consider it magic.
Git itself is merely a piece of software that you can install on your computer, although Mac and Linux computers usually come with it. Once installed, Git is used in the command line. (If you're not familiar with the command-line, also known as the terminal, that will be the topic of a future post.) As part of your coding workflow, you simply have to enter a few commands, and Git will automatically keep track of every version of code you create.
To tie it all together: Git is a piece of software that you can use by entering certain commands in the command-line. Git is a version control system, meaning that it keeps track of every version of your codebase. This way, if you need to find or revert to a previous version, you can do so easily. Because it's so easy to use, Git has become one of the most popular tools among the developer community. Git works with any type of file, so it doesn't matter what programming language you're working with in the codebase.
Now, what is Github? Github deserves a post unto itself, but to keep things very simple for now: Github is a website that allows you to store your code on the web. Storing your code on the web has a number of advantages, including backing up your code and collaborating on your code with others.
Github includes the word "Git" in its name because Github is set up so that one actually uses Git to store their code on the Github website. That is, with a few commands from the command-line, you can store your codebase on Github. But while Git is a open-source software, Github is a commercial website that is currently owned by Microsoft.
Because of Git and Github's popularity, they are both worthwhile things to learn when you're learning to code.
Get Expert Advice
The Actualize Blog is where you can get expert advice and insights for learning to code from our CEO, Jay Wengrow. Subscribe to the Actualize Blog and get notified each time we publish a new article.