What is Git and GitHub? Are they same?
Hi, if you're here, you probably may have heard developers using the words - 'Git' and 'GitHub'. Or you already have some experience using them, but always doubted if they are the same things.
This is what happens when programmers are allowed to name things and not the marketing people.????
There are a lot of resources out there that teach you how to use them, but there are only a few that tells you what those really are...
In this article, I will explain Git and GitHub with a simple high-level abstraction.
Version Control System (VCS)
This is where it all begins...
What the heck is a version control system and why are we talking about it?
Imagine you are writing a story.
You probably use a text editor like Word.
Halfway through your writing, you felt that you need to change some paragraphs and add some more characters to the story. You did that and continued your writing.
An hour more into your writing, you felt that the characters you added are of no use to the story and you want to undo everything you changed.
Of course, you can use the undo button. But what if you closed your word application right after you made those changes.
The undo button is not going to work.
What if you were writing a huge novel and you want to undo a lot of changes you made like 3 months ago?
This is where something called a version control system can help.
Version Control System helps you to understand the history of the file and see what are all the changes that happened over time.
If you want, you can even go back to a particular "save" of the file.
That's cool, right???
A Version Control System is like a "save" program for your work. Your work can be a coding project or even a novel.
VCS allows you to save, track, log, review and restore all versions of your work.
There are 3 different types of VCS.
Without going into any detailed information, let's try to get a little taste of what each one is.
Local Version Control System
We often create folders and copy our work in a folder. We come back later and make some changes, then maybe copy it to another folder with a timestamp or a different filename. Local VCS also works similarly.
Everything under a local version control system exists within a local computer. It's for an individual user and everything kept within his computer. There is nothing shared online. Revision Control System is an example of one such software.
Centralized Version Control System
This is like we save our work both on our computer and also on a centralized server. A major upgrade from Local VCS to Centralized VCS was, people can start to collaborate on projects they do.
Those who have access to that server can check out the files uploaded by the other person and can make changes. He can then upload them back to the server.
But what happens if that server fails or is unavailable for some reason? Well, you risk losing everything.
Distributed Version Control System
Distributed VCS is an upgrade to that drawback of centralized VCS.
Here files are not just downloaded with their latest changes when someone check out from the server.
领英推荐
The entire change history is copied.
In other words, it's a "mirror" of the entire repository(repository is just a folder in the context of a VCS).
So if the server dies, then any of the client repositories can be copied back to the server again. Every clone is a full backup of the data.
Git is one such distributed VCS.
Git was developed by the creator of the Linux kernel, Linus Torvalds about 15 years ago.
Linux community was using another distributed VCS called BitKeeper before that. But the Linux community and the company that owned BitKeeper broke off and that led to the invention of Git.
The major goals in the creation of Git were
And of course, it's free and open-source.
Git is installed and maintained on your computer. You don't need a cloud service or even the internet to use Git!
You can use Git on your computer to give you the record of all the versions of the "saves" you have committed on your work/project.
Note that everything related to the git is done on the command line.
Okay, but how do we share or access our work outside our computer?
The answer is GitHub.
GitHub
GitHub is a for-profit company and it was recently owned by Microsoft.
It's a file hosting service and it has a website.
It's an online database to helps you to host and keep track of your git version-controlled files outside your computer.
So what most developers do is, all the version control tasks are done on their computer using git. Then to share online they use the website GitHub.
Even though it's a for-profit company, all of the basic features are available for free and that makes GitHub much popular.
It has all the capabilities of git, plus it provides cloud storage with a graphical user interface.
Conclusion
Git is a version control system that lets you manage and keep track of your source code or file change history. It uses a command line and it's within your computer.
GitHub is a cloud hosting website that lets you manage git repositories and have all the features of git.
Hope this article has helped you to get a better idea about Git and GitHub.
Thanks for reading.??