r/github • • Apr 20 '20

what's the difference between git and github?

272 Upvotes

45 comments sorted by

432

u/ahinkle Apr 20 '20

It's the difference between porn and pornhub.

14

u/[deleted] Apr 21 '20 edited Aug 30 '20

pornhub pages

pornhub

porn

pornhub live

***

github

github pages

git

github live

6

u/pragyan52yadav Apr 21 '20

What's GitHub live?

7

u/Compu7erUser Apr 21 '20

If you like Github...

88

u/VxJasonxV Apr 21 '20

This is quite possibly the best way I’ve ever heard it explained.

0

u/[deleted] Apr 21 '20

[deleted]

6

u/VxJasonxV Apr 21 '20

yes it really is

26

u/Strykrol Apr 21 '20

Virgin control and pull requests, there’s some sort of joke in there maybe

6

u/kennyjiang Apr 23 '20

I'll approve the merge

16

u/benji0110 Apr 21 '20

This is the best way to explain it ever unless you've never heard of Pornhub

3

u/ferueda Apr 21 '20

Holy shit, you're a genius. I'm using this analogy from now on.

3

u/eggtart_prince Apr 21 '20

OMG, I fully understand now. Thank you.

4

u/yousufkalim Apr 21 '20

Understood

3

u/shukian Apr 22 '20

I saw this question and comment in screenshot in a funny FB post and just googled to find this and give you Kudos !

3

u/floridaturtles Apr 22 '20

Take this medal 🏅

3

u/[deleted] May 04 '20

Bro you went viral, this is all over Facebook programming groups and what not

4

u/user3141592653589 Apr 21 '20

This. You win the internet today.

2

u/Alamo985 Apr 23 '20

Take my upvote you beautiful bastard.

2

u/tripialos Apr 23 '20

God mode: ON

2

u/heysub May 06 '20

came here to upvote

2

u/[deleted] May 23 '20

lol needs an eli5 award

2

u/oluseyeo Dec 09 '23

From Twitter 3years after just to give kudos for this succinct explanation 🫡

11

u/[deleted] Apr 20 '20 edited Apr 20 '20

Git is a source control system. It allows you to track changes to code files down to the exact line and characters changed. Imagine you got a school project working after hours of coding. Then, you need to add a feature that will change some existing code. You're scared to mess your program up, so you copy all of the code to another folder, making your new feature changes to the original copy. Git solves this by allowing you to have different "copies" of your source files (called branches) without actually copying the files. It does this by keeping a history of all changes (called commits) and the order they occurred in, so you can rewind, undo, or even develop two features in parallel without them affecting each other.

Any computer can host a git repo (repository, a "folder" of code that git tracks changes to). Github allows you to host it on their platform and adds a nice GUI as well as features for collaborating with other users on the same repo (like Pull Requests). Repos on Github can be private or public, so you can use it for publishing to the world (and getting strangers to collaborate with you!) or keep it private it and use it for your company/personal projects.

EDIT: Git is HUGE. This is a very simplified explanation that only scratches the surface.

3

u/pragyan52yadav Apr 20 '20

Ok got it Thanks

2

u/realRohitYadav Apr 23 '20

Didn't you understand from the most up voted comment?

4

u/primaski Apr 20 '20

Git is a local version control system. All changes you've made to your code (that you've committed) are stored in your .git folder on your device itself. You don't need GitHub to use Git. Git will let you restore previous versions of your work, and save new ones - without ever connecting to the Internet. GitHub, on the other hand, is a "Cloud" like service. It stores your Git repository online, which serves as a backup for you, and allows others to clone the git, and commit their own changes to the Git repository - which you can then pull to your local machine. GitHub is one of the most common ways to share your Git repository and collaborate on projects with other people. tl;dr A Git is a locally stored version control system, and a GitHub is an online "hub" for Git repositories (you need a Git repo to upload to GitHub, but you don't need GitHub to have git repos)

2

u/pragyan52yadav Apr 20 '20

Thanks

1

u/primaski Apr 20 '20

Happy to help!!

44

u/li-357 Apr 20 '20

Git is a version control system that tracks your changes and manages source code. It's a piece of software. GitHub is a platform to store those changes "in the cloud."

1

u/No_Armadillo7430 Apr 20 '23

Is this a piss-take?

1

u/No_Armadillo7430 Apr 20 '23

Is this a piss-take?

1

u/No_Armadillo7430 Apr 20 '23

Is this a piss-take?

8

u/mhzawadi Apr 20 '20

Also git is not client - server, you can be both a client and a server.

You don't need GitHub to use got!

19

u/herrozerro Apr 20 '20

Email vs Gmail

1

u/Sunil-Asia Apr 21 '20 edited Apr 22 '20

First of all, GitHub is not git. Many people used to get confused with these two. So in short, the difference between Git and GitHub:

Git is the tool, and GitHub is a website for hosting projects that use Git.

I have written an absolute beginners guide for new Git user, if you are interested then must check out :

Getting started with Git and GitHub: the complete beginner’s guide

2

u/I_AM_NOT_MAD Apr 21 '20

Git is a system of version controll and isn't centralized to one service, GitHub is just one service of git. You also have gitlabs, bitbucket, and many more I don't know of

1

u/ride_whenever Apr 20 '20

It’s essentially software vs SaaS

2

u/[deleted] Apr 20 '20

If he doesn't know about Github I doubt he knows what SaaS is ;)

1

u/[deleted] Apr 21 '20

Githib and git lab are to git what coca and Pepsi are to soda...

1

u/Miner_ChAI Apr 21 '20

Git is a tool for managing repositories and GitHub is a hosting service for these repositories

1

u/lazybong May 03 '20

When you see same porn in pornhub posted by different users, it's a fork. 😂