Git and GitHub
Git and GitHub
Git vs. Github comparison is constantly being doubtful for many
beginners. Obviously, there are quite few similarities between these two systems
but it is the difference between Git and GitHub is the most apropos.
Git- git is a system for version control. Preliminary used by
programmers and others who write codes. It runs in the command line of your
local machine. It allows you to keep the track of your files and modifications
to those files in something called repository or repo. You can use it alone with the repositories or
group of people who working on the same project. It is useful in team
environment because everyone can work independently on these files, merge their
changes together and there is a way to record changes.
GitHub- GitHub is a web site that
allows you to upload your git repositories online.
|
What’s the use
of uploading files in GitHub??
Well...It provides you back up for your files. It gives you a
visual interface to navigate in repos. It gives other people a way to
navigate in your repos. Hence it makes repo collaboration easy.
Git doesn’t
require the use of GitHub. However it is very common to use GitHub and much
useful to use GitHub if you’re using Git.
|
What is the Difference between Git and Github?
Git is a
distributed version control tool that can manage a development projects’ source
code history which is a tool installs locally on computers by the developers.
Github is a cloud based platform which is an online service that stores code
pushed to it from computers where the Git tool is running.
Key difference is Git is an open source tool which developers
install locally to manage source code while Github is an online service which
developers who use Git can connect to upload, download or share resources.
|
Git
|
Github
|
|
Installed
locally
|
Hosted
in the cloud
|
|
First
released in 2005
|
Company
launched in 2008
|
|
Maintained
by the Linux Foundation
|
Purchased
in 2018 by Microsoft
|
|
Primarily
in command line tool
|
Administered
through website
|
|
Provides
a desktop interface named Git Gui
|
Desktop
interface named GitHub Desktop
|
|
No
user management features
|
Built
in user management
|
|
Competes
with Mercurial, Subversion, IBM, Rational Team Concert and ClearCase.
|
Competes
with Atlassian Bitbucket and GitLab
|
|
Open
source licensed
|
Includes
a free tier and pay-for-use tiers.
|
Terminologies used in GitHub
- Fork - you simply make a copy of your repo in your account. That copy includes all the repository files and even the commit history is preserved. Usually we fork a repo either if we want to copy a file or if you intend to contribute in that repo.
- Clone - Cloning is the coping of an existing Git repository from a remote source with the help of the url or the repository can be directly downloaded in local machine. Then changes can be made to project files. This feature brings down all files and history to your machine. It creates a remote connection called origin that point back to the original repository.
- Add commit - when we make the changes to the project copied to local machine we can add those changes to remote repository using git add command.
- Commit - Git commit is used to commit the staged snapshot to your history of a git repo. By using git commit –am “comment” single command both adding and committing can be done.
- Push – Use to transfer commits on your local directory to your remote directory
- Branch – branch is an isolated copy of your working environment and history. Commits are recorded in the history for the current branch. You can create number of branches and connect them each other. One branch will be the master branch.
- Merge – a way of taking one branch and merging its history/commits into another branch.
- Git pull and Git fetch –
$ git pull origin master
Git pull, in contrast, is used with a different goal in mind, to
update your current HEAD branch with the latest changes from the remote server.
This means that pull not only downloads new data, it also directly integrates
it into your current working copy files.
$ git fetch origin
Git fetch really only downloads new data from a remote repository.
But it doesn't integrate any of this new data into your working files. Fetch is
great for getting a fresh view on all the things that happened in a remote repository.
- Pull request – In GitHub a way to notify other users that there is a branch ready for a review. A pull request provides collaborators with the ability to discuss and make commits about changes made.
Things I've mentioned above are some of the most helpful things about Git and Github.
You can learn rather advance things about github using https://guides.github.com/ and there are many more sites for that. If there is any mistake or if you're willing to know any thing else please use the comment section below. Thank you.

Comments
Post a Comment