DEV Community

foadlind
foadlind

Posted on • Originally published at practicalgit.com

Git vs. GitHub: an explanation for absolute beginners

This is a question a lot of Git beginners have:

"What is the difference between Git and GitHub?"

It can be confusing to understand their difference when you first encounter these new concepts. In this article I will try to give you some context for how Git and GitHub are related and what that means to you.

Git is the version control software you can use locally on your machine to keep track of changes you make to your projects. Git is an open-source project itself that was made by the team developing Linux operating system to keep track of the changes to their code. There are other version control software beside Git (Subversion, Mercurial, etc), but Git is by far the most common and most powerful.

GitHub is a web service that allows you to store your projects in the cloud using Git. You don't need GitHub to be able to use Git. But if you want to back up your projects in the cloud or share it with others, you can use GitHub.

GitHub is not the only option though. There are at least two other major ones: GitLab and Bitbucket.

Apart from storing your project files and your project's Git history, these services provide other tools that are useful for collaborating with others. Things like code review tools, project management tools, team communication tools, bug tracking, etc.

Sooner or later you will need to collaborate with others on a project. Usually you will do that by uploading your code (pushing it) to GitHub. Then others can download (clone) your code and start working on it. When they have made some changes and want to share it with you, they push it up to GitHub. Then you can pull the changes down to your local Git and see what they have done. This is the ground of all collaboration done on GitHub and is the central workflow for all Git projects.

In order for Git to send your project to GitHub, you need to give your project a remote address. You can go to GitHub and create a home for your project, called a repository. Then you give the address of that repository to Git. After that you are able to just push your files to its new remote home on GitHub.

You can also download other people's work from GitHub. This process is called cloneing. You clone a repository like this:

$ git clone <address-of-the-repository>
Enter fullscreen mode Exit fullscreen mode

You can find the address of the repository from it's GitHub page. It usually looks something like this: git@github.com:username/some-cool-project-name.git

So in summary, Git is a version control system and GitHub is a web service that helps you collaborate with others using Git.
I hope this article helped to clear some of the confusion around Git and GitHub! 🙂
I have also created a Git cheat sheet for beginners. If you are interested, grab a free copy from here.

Top comments (0)