r/github • • Apr 20 '20

what's the difference between git and github?

272 Upvotes

45 comments sorted by

View all comments

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?