What is GitHub and how to use it?
GitHub is a web based hosting service for version control . It uses Git. It is an open source code management system created by Linus Torvalds . It has all capabilities of Git with some other additional important features.
In this article , We will take step by step discussion about GitHub. Before knowing the it, It is more important to What is Git ?
Git is a version control system which keep track changes in computer files and folders and coordinating work on those files among multiple people . Git is primarily used for source code management in software development . It is developed by Linus Torvalds .
Before Git , Linux developer uses BitKeeper for source code management . But After BitKeeper announcement for withdrawn from free use , many developer of linux kernel gave up access to BitKeeper .
GitHub vs Git
Git is a revision control system , a tool for manage your source code history , Whereas GitHub is a hosting service for Git repositories .
What is GitHub ?
- It is Web based hosting for version control.
- It provides access control , bug tracking , task management , wikis for every project.
- It offers plans for both private repositories and free account.
- Make it easy for open-source project contribution.
- It has desktop software & many other features .
- Free account is used for open source software projects.
- It has more than 28 million users and 57 million repositories .
- In June 2018 , it is acquired by Microsoft .
How to use GitHub
For using it, First you have to create an account on GitHub official page.
For creating an account go to https://github.com/
provide your username , Email and password and click on Sign up button .
After Successfully sign up on it , go to login page and sign in with your username and password .
After successfully login , GitHub main page appears . It shows two options. First is Read the guide, where you can read about GitHub and their tutorials . And other is Start a project, where you can create a project.
When you go through Read the guide, it describe about GitHub and repositories . This page also contains video tutorials of GitHub.
When you go through start a project , It opens a page where you can create your own repository.
You give any name according to your choice to repository name . By default it is public. If you want to create a private repository , you have to pay some money for that to GitHub. In company, They generally used private repository for version control and for sharing source code among their developers .
click on create repository . It will create a new repository for you.
Repository :- It is usually used to organize a single project . It can contains folders, files, videos and data sets – any thing that your project needs . It also offers some common options such as a license file .
Branch :- Branching is the way to work on different versions of repository at one time. By default any repository has only one branch named master , which is considered to be the ultimate branch . When you create a branch off the master branch, you are making copy or snapshot of master .
Commit :- On GitHub save changes are called commit. Commit message captures the history of your changes, so other contributors can understand why you have done and why .
Pull Request :- When you open a pull request, you’re proposing your changes and requesting that someone review and pull in your contribution and merge them into their branch.
To Create new branch :-
- Go to your new repository firstrepo
- Click the drop down at the top of the file list that says branch: master.
- Type a branch name, developer-branch, into the new branch text box.
- Select the blue Create branch box or hit “Enter” on your keyboard.
Now developer-branch is created. you can see number of branch now becomes 2 .
To use desktop software, You have to download it from their official website.
Here I am using windows 64 bit operating system, You can also download desktop software for different operating system like macOS . Click on download link to download it. After downloading , you have to install in on your computer. When you run this application, it looks like given below.
Here you can create a new free account as well as you can singn into GitHub.com and GitHub Enterprise .
When you click on Sign into GitHub.com , it opens a new screen , where you have to provide your username and password of your account.
When you successfully sign into account , it opens a screen as shown in below. Here you have different options. If you want to create a new repository, click on create new repository. If you want to add local repository, click on Add a local repository. You can also clone an existing project from GitHub to your computer. To do this , just click on Clone a repository .
Now I am going to clone my existing repository from GitHub.com to my computer. To do this, click on clone a repository. It opens a new screen as shown below.
Select your repository and click on clone. It will create a local copy of your repository.
Here You can see that a local copy of your repository is created . I hope this article is useful for you.