# What is the difference between Git and GitHub

**URL:** <https://forum.freecodecamp.org/t/what-is-the-difference-between-git-and-github/138786>\
**Category:** General\
**Created:** [July 28, 2017, 5:58pm UTC](https://forum.freecodecamp.org/t/what-is-the-difference-between-git-and-github/138786 "2017-07-28T17:58:02Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Win\_Key](https://avatars.discourse-cdn.com/v4/letter/w/e5b9ba/32.png) [@Win\_Key](https://forum.freecodecamp.org/u/Win_Key)\
**Post date:** [July 28, 2017, 5:58pm UTC](https://forum.freecodecamp.org/t/what-is-the-difference-between-git-and-github/138786/1 "2017-07-28T17:58:03Z")

</div>

I am confused with git and git hub. What is difference between them and their real time application?

---

<div class="post-metadata">

**Author:** ![michaelhenderson](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/michaelhenderson/32/356215_2.png) [@michaelhenderson](https://forum.freecodecamp.org/u/michaelhenderson)\
**Post date:** [July 28, 2017, 6:00pm UTC](https://forum.freecodecamp.org/t/what-is-the-difference-between-git-and-github/138786/2 "2017-07-28T18:00:20Z")

</div>

Git is a revision control system, a tool to manage your source code history. GitHub is a hosting service for Git repositories. So they are not the same thing: Git the tool, GitHub the service for projects that use Git. To get your code to GitHub: have look here : [https://help.github.com/articles/create-a-repo](https://help.github.com/articles/create-a-repo)

---

<div class="post-metadata">

**Author:** ![ppc](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ppc/32/63349_2.png) [@ppc](https://forum.freecodecamp.org/u/ppc)\
**Post date:** [July 28, 2017, 6:12pm UTC](https://forum.freecodecamp.org/t/what-is-the-difference-between-git-and-github/138786/3 "2017-07-28T18:12:32Z")

</div>

sorta like wordpress and [wordpress.com](http://wordpress.com) - anyone can set up and run their own wordpress site - [wordpress.com](http://wordpress.com) is a business built around not having to do that - similarly anyone can set up and run their own git server - [github.com](http://github.com) is the business equivalent of [wordpress.com](http://wordpress.com)

the basic problem solved by git is distributed file version management - this is needed by programmers to track changes to their program source files and collaborate with others

---

<div class="post-metadata">

**Author:** ![cndragn](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/cndragn/32/159093_2.png) [@cndragn](https://forum.freecodecamp.org/u/cndragn)\
**Post date:** [July 28, 2017, 6:41pm UTC](https://forum.freecodecamp.org/t/what-is-the-difference-between-git-and-github/138786/4 "2017-07-28T18:41:47Z")

</div>

Im new to this too and its super confusing, but what Ive been able to gather, git is the actual version control system that you use locally to make your repos and commits.

Github is a cloud based service for collaboration, so instead of just having the repos only on your local system, you can upload, or rather push them to Github where others can see and pull the repos to their local system to work on the repos too. Github is not the only cloud based service btw, there are a couple more out there.

So with git, you can push to Github, or any other cloud based service for collaboration, to show people your code, or as backup.

---

<div class="post-metadata">

**Author:** ![Banhawy](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/banhawy/32/27242_2.png) [@Banhawy](https://forum.freecodecamp.org/u/Banhawy)\
**Post date:** [July 28, 2017, 7:03pm UTC](https://forum.freecodecamp.org/t/what-is-the-difference-between-git-and-github/138786/5 "2017-07-28T19:03:16Z")

</div>

Git is the **version control software** and Github is a **website service** that **hosts** documents/repositories tracked by git. Another example of github is _bitbucket_.  
To learn more about the differences and how to use github, Udacity has an excellent free course on github and version control [here](https://www.udacity.com/course/version-control-with-git--ud123).

---

<div class="post-metadata">

**Author:** ![akshaynaik404](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@akshaynaik404](https://forum.freecodecamp.org/u/akshaynaik404)\
**Post date:** [July 28, 2017, 10:54pm UTC](https://forum.freecodecamp.org/t/what-is-the-difference-between-git-and-github/138786/6 "2017-07-28T22:54:16Z")

</div>

The difference between Git and Github should be clear by reading comments above.

Now let’s see where you use it.

Consider you have a directory with a file named Progress.txt.

You initialize git in that directory using `git init`.

on Day 1: You will write something as shown below to Progress.txt, then run `git add Progress.txt` and `git commit -m 'Day 1 Progress'`

```auto
// Progress.txt
Day 1: Learned Code Comments

```

On Day 2: You will add the file again to the staging area and commit it like before.

```auto
// Progress.txt
Day 1: Learned Code Comments from mdn.com
Day 2: Created my first ever HTML file with the help of codepen.io.

```

So on and so forth, you did this for one month.

Suddenly one of your mentors comes and asks about your progress this month, you happily show the Progress.txt and the mentor is satisfied. You also show this file to your friends and they are really glad that you are working so hard, but while showing it to your parents, they express doubt that you might have filled the Progress.txt file in one go just to show them.

Thank god you used **Git** to track your progress. You immediately run `git log --online` to show them your commit history, but ENOUGH IS ENOUGH! You decide that you’ll use **Github** to share your progress with others.

You immediately create an Account and create a repository named `progress`. Then from inside your local directory, you execute `git remote add origin https://github.com\/<yourusername\>\/progress.git` and `git push -u origin master` and your code is published on Github for everyone to see. You also link this file to your website for everyone to see.

Now everyone can view your progress and see that you work every day and push your progress to GitHub. Your mentor can just look at it to know how you are doing and your parents are happy looking at your commit history on GitHub.

_Its 🕟 4:30 AM now, So if you still haven’t got the gist of What git and GitHub is all about?, I will complete this answer tomorrow_

---

<div class="post-metadata">

**Author:** ![anon52159105](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@anon52159105](https://forum.freecodecamp.org/u/anon52159105)\
**Post date:** [July 29, 2017, 12:57am UTC](https://forum.freecodecamp.org/t/what-is-the-difference-between-git-and-github/138786/7 "2017-07-29T00:57:34Z")

</div>

Git is a version control system - GitHub is a website that hosts Git Repos and makes collaboration easier for open source projects.

---

<div class="post-metadata">

**Author:** ![wadie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/wadie/32/94485_2.png) [@wadie](https://forum.freecodecamp.org/u/wadie)\
**Post date:** [July 29, 2017, 1:02am UTC](https://forum.freecodecamp.org/t/what-is-the-difference-between-git-and-github/138786/8 "2017-07-29T01:02:35Z")

</div>

Another example for a hosting server for Git repositories is Bitbucket which also uses Git the tool and hosts private repositories. 🙂

---

<div class="post-metadata">

**Author:** ![owel](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/owel/32/48425_2.png) [@owel](https://forum.freecodecamp.org/u/owel)\
**Post date:** [July 29, 2017, 2:41am UTC](https://forum.freecodecamp.org/t/what-is-the-difference-between-git-and-github/138786/9 "2017-07-29T02:41:48Z")

</div>

If you’re working solo on your project, and don’t need to share your files/source code with anyone else, you can install git on your computer and have all the advantages of source control.

The wrinkle is if you need to collaborate with another person. You can give that person access to the project directory on your computer but that becomes complex real fast when you need to factor in security, 24/7 uptime of your computer so your collaborator can access it at any time, touting and firewall setup to give outsiders access to your personal computer. Or maybe it’s not jus possible if the said computer is also your laptop that you have to take with you.

That’s where github comes in… Github can host the same project files so you, your friend, and possibly other collaborators ACB all work on the same project.

Bottom line, you don’t have to sign up to github to use git if it’s only you working. But even for a solo developer, github may still be useful as it provides you with a remote copy/backup of your project… in case something happens to your hard drive or your laptop stolen etc.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 16, 2021, 5:59pm UTC](https://forum.freecodecamp.org/t/what-is-the-difference-between-git-and-github/138786/10 "2021-01-16T17:59:04Z")

</div>

Closed on January 16, 2021, 5:59pm UTC


