Git vs Github: understanding their difference

  • Thread starter fog37
  • Start date
  • #1
fog37
1,568
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:

1. What is Git?

Git is a version control system that allows multiple developers to work on a project without interfering with each other's changes. It enables tracking of changes, restoring previous versions, and managing code history locally on your computer.

2. What is GitHub?

GitHub is a web-based platform that hosts repositories online and provides additional features to Git, such as graphical interfaces, issue tracking, and collaboration tools. It allows developers to share their repositories and collaborate on projects from anywhere in the world.

3. How do Git and GitHub work together?

Git and GitHub work together by Git being used for local repository management on your computer, handling code changes and version control. Meanwhile, GitHub serves as the remote server that hosts your repositories online and facilitates collaboration among multiple developers. You use Git to push changes from your local machine to GitHub, allowing others to see and contribute to the project.

4. Can you use Git without GitHub?

Yes, you can use Git without GitHub. Git is a standalone version control system and does not require GitHub to function. Developers can use Git locally on their computers to manage their projects, or they can choose to use other hosting services besides GitHub for online repository management and collaboration.

5. What are the main benefits of using GitHub in addition to Git?

The main benefits of using GitHub in addition to Git include enhanced collaboration features such as pull requests and code reviews, issue tracking, easy project management through graphical interfaces, and robust community support. GitHub also provides integration with many development tools and platforms, making it a versatile hub for project development.

Similar threads

  • Programming and Computer Science
Replies
4
Views
2K
Replies
3
Views
335
  • Programming and Computer Science
Replies
14
Views
1K
  • Programming and Computer Science
Replies
3
Views
650
  • Computing and Technology
Replies
15
Views
2K
  • Programming and Computer Science
Replies
15
Views
1K
Replies
2
Views
883
  • Programming and Computer Science
Replies
7
Views
480
  • Programming and Computer Science
Replies
13
Views
1K
Replies
10
Views
2K
Back
Top