How GitHub is connected to Git and basic difference Git and Svn.
Git and GiHub
So Git
and GitHub
are parts of one complex system, which complement each other:
- Git is the name of
VCS
(version control system) wrote by Linus Torvalds. There are always series ofcommits
(snapshots). You see a path of this snapshots, in which order they were created. You createbranch
for new features and use snapshot forrevert
changes. - GitHub is website on which you can publish your Git repositories and collaborate with other people.
The difference
Git is not better than Subversion. But is also not worst. It’s different:
- The key difference is that
Git
is adecentralized
. WithGit
you can do practically anything off-line, cause everyone has their own repository. For example: I have a server at home and a Laptop on the road. SVN simply doesn’t work well here. With SVN, I can’t have local source control if I’m not connected to the repository (Yes, I know about SVK or about ways to copy the repo). With Git, that’s the default mode anyway. With commandgit commit
you commit locally, whereasgit push origin master
- you push the master branch to the remote branch namedorigin
. - Making
branches
andmerging
between branches isGit
way. Everybody who likes your changes can pull them into their project, including the official maintainers. It’s trivial tofork
a project, modify it, and still keep merging in the bug-fixes from theHEAD
branch. - Git is perfectly suited for Open Source projects: just fork it, commit your changes to your own Fork, and then ask the original project maintainer to pull your changes.
- On the other hand Git adds
complexity
. Two modes of creating repositories, checkout vs. clone, commit vs. push… You have to know which commands work locally and which work with “the server”.
Make my day: