Published on

Git and Github are not the same thing!

4 min read

Authors

Developers might hear the word ‘git’ and ‘Github’ thrown around often, but, I found that among beginners there are some misunderstandings between the concept of those two. in this post, I will try to explain the difference between them, in an absurdly simple manner.

Git

Git is a free and open-source distributed version control system (VCS) created in 2005 by Linus Torvalds (The creator of the Linux kernel). According to StackOverflow, Over 90% of respondents use Git, suggesting that it is a fundamental tool for being a developer.

A version control system is basically a program that tracks and controls changes between files.

So by the name alone, you can probably conclude that git will somehow manage multiple versions of something. You probably guessed right, git will keep track of changes in your codebase.

The way git is tracking all said changes in a codebase is by creating a database inside your codebase. You see, whether you initiate a git-managed codebase with git init or clone an existing one with git clone, you will see a .git subfolder inside it, the prefix . means that it’s a hidden folder. To understand the structure of it you can check out this great article by Nick Farina.

You might also hear the word “Repository” or “Repo”, the .git folder IS the repository.

All the history of changes is tracked and stored in the repository, you can make any folder a repository then git will start to track all the changes that happen inside that folder.

Each change is stored with a commit, a commit means that you add the changes of the files to the commit-graph. This is what that graph would look like:

Because you have a history of all the changes that happen, you can go back to a point at any given time.

commit-graph

Git is a distributed VCS which means that multiple people can access and manipulate a repository simultaneously, so you and your peers can work together in the same codebase.

To do this, each people should have a copy of this repository, to do that you need to clone the repository. Ideally, a remote repository must be in place beforehand (even though it is not mandatory, but who wants to keep sending their compressed .git via email).

Github

So with all that being said, what is Github?

Github free cloud-based service to host your remote repositories, remote repositories stored in the cloud is more or less the same thing as your local one but only differ in their structure (red: bare repo).

If you want your local commits to be “uploaded” to the remote repo, you need to push them there. Only after that other people that have the same remote can see those changes. On the other hand, if you want to see the latest update on the remote repo, you need to fetch or pull the remote repo.

remote

Also, Github is not the only platform out there, there is GitLab, Bitbucket, Sourceforge, AWS CodeCommit, etc. They all do git the same way, just each with their own flavor of features.

The features that got my attention from Github are their Github Workflow (for managing automation based on events like push, merge, etc) and Github Projects (Kanban-based board that can be bound to an issue for planning and tracking).

Another notable feature that I think would be interesting for beginners is Github Desktop. Github Desktop is a desktop software that allows you to do various git operations from the GUI (git is a terminal program / CLI).

Conclusion

So the conclusion is that Git is a version control system that tracks and controls the changes in a codebase or repository, and Github is a cloud service that allows you to host your repository in the cloud so you can manage and collaborate in your repository easier.

Thanks for reading!