Git vs Github: understanding their difference

  • Thread starter fog37
  • Start date
In summary, Git and Github are both tools used for version control in software development, but they serve different purposes. Git is a distributed version control system that allows developers to track changes and collaborate on code locally, while Github is a web-based hosting service that provides a platform for developers to store, share, and collaborate on code remotely. In short, Git is the tool, while Github is the platform that utilizes Git.
  • #1
fog37
1,569
108
Hello,
I am unsure I fully grasp the difference between Git and Github. This is what I think:

  • Git is a free, open-source application for version control that runs locally on our machine. It is command line based.
  • Github is a free hosting platform "based on Git" that was created by Microsoft. We can create online repositories containing our versions, share the versions and the repositories, collaborate, etc. which is something that we cannot do with Git.
  • Git seems to be more for personal use to keep up with our versions in an organized fashion. I feel like when we are using Github we are essentially using Git on the web. By analogy, we can use Word on our own local computer but can also use Word on the cloud as part of Microsoft 365. Same software but in different settings (Github has also extra features that Git does not have).
  • Github is also more GUI based than regular Git. However, now we can use Git Desktop which essentially works like Git but with a GUI interface...
Thanks!
 
Computer science news on Phys.org
  • #2
fog37 said:
Hello,
I am unsure I fully grasp the difference between Git and Github. This is what I think:
They are completely different things, it's like contemplating the difference between the French language and the Bibliothèque nationale de France.
fog37 said:
Git is a free, open-source application for version control that runs locally on our machine. It is command line based.
Yes.

fog37 said:
Github is a free hosting platform
Yes.

fog37 said:
"based on Git"
Not really, it is a hosting platform for collaboration on software repositories held in Git but it does a lot of things that have nothing to do with Git (issue tracking, GitHub actions, GitHub pages...)

fog37 said:
that was created by Microsoft.
No, GitHub was created and run by an independent team for 10 years before Microsoft acquired it in 2018.

fog37 said:
We can create online repositories containing our versions, share the versions and the repositories, collaborate, etc.
Yes.

fog37 said:
which is something that we cannot do with Git.
This is a mismatch of concepts: it's like saying you can borrow a book from Bibliothèque nationale de France but you can't borrow a book from the French language.
 
  • Like
Likes jedishrfu and fog37
  • #3
The way I see it is that git acts like hiring a filing clerk and a filing cabinet to support your project. The clerk can then do a variety of tasks like taking a snapshot of the current state of your task, extracting older states from the cabinet, maintaining different development histories in parallel, and even complicated but non-creative tasks such as generating a new snapshot by merging two others. You might issue instructions to your clerk using the command line or one of several GUIs.

If you and I are collaborating on a project we each have our own file clerk and cabinet (local repository). Usually we'd also maintain a central repository with its own clerk, and have the clerks pull and push parts of the central repository to and from our local ones. It's also possible to add a third (fourth, fifth...) dev as long as they have access to the central repository.

GitHub provides a place to put your central repository. It also adds a lot of tools like issue trackers and project management that aren't part of git but are more or less necessary for any non-trivial project.
 
Last edited:
  • Like
Likes fog37 and pbuk
  • #4
Also worth noting that GitHub is a company (or a branch of Microsoft these days), a product, and a particularly popular instance of the product. AFAIK you can buy (or licence, I dunno) GitHub-the-product from GitHub-the-company and run your own private GitHub inside your company intranet. Apart from the web address it looks and functions just the same as GitHub-the-public-and-popular-instance we all have access to, but only folks on your corporate intranet can access it.

Usually when people say "I put it on GitHub" they mean the public one. But if you're in a corporate environment talking to colleagues they might mean their own private instance.
 
  • Like
Likes pbuk
  • #5
Perhaps a bit of history also helps.

There have been many different version control systems: CVS, Subversion (SVN), Mercurial, Git...
There have also been many different collaboration platforms: Sourceforge, BerliOS (my favourite in its time but now defunct), Bitbucket, GitHub, GitLab...

Historically collaboration platforms supported different VCS but GitHub and GitHub have only ever supported Git, and now Bitbucket has dropped Mercurial, Git is pretty much the only game in town.
 
  • Like
Likes Ibix
  • #6
Jeez, I'm having PTSD flashbacks to Git/GitHub/CVS/Subversion days.

I lost a lot of hair trying to Commit and Merge branches into the main.
 
  • #7
Ibix said:
AFAIK you can buy (or licence, I dunno) GitHub-the-product from GitHub-the-company and run your own private GitHub inside your company intranet. Apart from the web address it looks and functions just the same as GitHub-the-public-and-popular-instance we all have access to, but only folks on your corporate intranet can access it.
This is called GitHub Enterprise. It is not exactly the same as the code running github.com but it offers essentially the same functionality to end users plus some more features.
 
  • #8
In prehistoric tymes there were SCCS and RCS systems and before that simple tape repositories of program code that was updated via 80-col cards in a deck with control cards indicating what to delete, where to insert or where to replace.

The tape systems had no notion of version history whereas the SCCS and RCS systems did.

https://en.wikipedia.org/wiki/Source_Code_Control_System

Remnants of these systems are sprinkled throughout the more modern CVS and Subversion systems...
 
  • #9
Ibix said:
The way I see it is that git acts like hiring a filing clerk and a filing cabinet to support your project. The clerk can then do a variety of tasks like taking a snapshot of the current state of your task, extracting older states from the cabinet, maintaining different development histories in parallel, and even complicated but non-creative tasks such as generating a new snapshot by merging two others. You might issue instructions to your clerk using the command line or one of several GUIs.

If you and I are collaborating on a project we each have our own file clerk and cabinet (local repository). Usually we'd also maintain a central repository with its own clerk, and have the clerks pull and push parts of the central repository to and from our local ones. It's also possible to add a third (fourth, fifth...) dev as long as they have access to the central repository.

GitHub provides a place to put your central repository. It also adds a lot of tools like issue trackers and project management that aren't part of git but are more or less necessary for any non-trivial project.
I guess my confusion started by thinking that I can sign up and work on Github alone (without ever worrying about downloading and using GIT). On Github, create repositories, add files, modify files, etc. on Github..which sound exactly what Git does...that is why I have been thinking that Github is just the web version of Git...incorrectly I guess...

For example, I have create a simple text file directly in Github, tweaked such file, made branches, etc. exactly what I would do in Git...
 
Last edited:

FAQ: Git vs Github: understanding their difference

What is Git?

Git is a distributed version control system that allows multiple developers to work on a project simultaneously without overwriting each other's changes. It tracks changes to files and facilitates collaboration by managing different versions of a project. Git operates locally on your computer, providing fast performance and enabling you to work offline.

What is GitHub?

GitHub is a web-based platform that uses Git for version control and provides a collaborative environment for developers. It hosts repositories online, making it easier for developers to share their code, collaborate on projects, and manage issues and pull requests. GitHub also offers additional features like project management tools, code reviews, and integrations with other services.

How do Git and GitHub differ in terms of usage?

Git is used locally on your computer to manage the version history of your project. You use Git commands to commit changes, create branches, and merge code. GitHub, on the other hand, is used to host repositories online, enabling collaboration with other developers. You push your local Git repositories to GitHub to share your code and collaborate with others.

Can you use GitHub without knowing Git?

While it is possible to use some features of GitHub without knowing Git, such as browsing repositories and opening issues, a basic understanding of Git is essential for effective collaboration. Knowing Git commands allows you to clone repositories, make changes, commit updates, and push your changes to GitHub, making the development process smoother and more efficient.

Are there alternatives to GitHub that also use Git?

Yes, there are several alternatives to GitHub that also use Git for version control. Some popular alternatives include GitLab, Bitbucket, and SourceForge. Each platform offers its own set of features and integrations, so the choice depends on your specific needs and preferences for project management and collaboration.

Back
Top