11
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
1
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
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
1
1
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
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
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
1
1
u/Miner_ChAI Apr 21 '20
Git is a tool for managing repositories and GitHub is a hosting service for these repositories
1
432
u/ahinkle Apr 20 '20
It's the difference between porn and pornhub.