Introduction to GitHub day1
Published: 2020-10-03 14:45:37

GitHub is a website and service that we hear geeks rave about all the time, yet a lot of people don’t really understand what it does. Want to know what all the GitHub hubbub is about? Read on to find out. 
**What is GitHub?**

GitHub is a file or code-sharing service to collaborate with different people. 

GitHub is a highly used software that is typically used for version control. It is highly used especially when more one person is participating in a project.
**Advantages of using GitHub**
1. GitHub provides you a beautiful visual interface which helps you to track or manage your version controlled projects locally.
2. Once you register on GitHub, you can connect with social network and build a strong profile.
3. It makes it easy to contribute to your open source projects
Now lets get started with GitHub..

**How to create a GitHub account**
To create a GitHub account visit [GitHub Website](github.com/) and fill the sign up form then click on start a new project.![project](https://dev-to-uploads.s3.amazonaws.com/i/058thr5sfe2nbkorwfkb.png)
**Create a new repository**

A repository is a storage space where your project lives. It can be local to a folder on your computer, or it can be a storage space on GitHub  or another online host. You can keep code files, text files, images or any kind of a file in a repository. You need a GitHub repository when you have done some changes and are ready to be uploaded. This GitHub repository acts as your remote repository. So let me make your task easy, just follow these simple steps to create a GitHub repository.
![repo](https://dev-to-uploads.s3.amazonaws.com/i/qgtsuonrtlew2mx2ezxm.png) 
Fill the required details and click on create repository button.
This is how it looks once you create it
![gittutorial](https://dev-to-uploads.s3.amazonaws.com/i/oknfpx1dgqjqxrgfpgas.png)
**How to create a branch**

**Branching**: Branches help you to work on different versions of a repository at one time. Let’s say you want to add a new feature (which is in the development phase), and you are afraid at the same time whether to make changes to your main project or not. This is where git branching comes to rescue. Branches allow you to move back and forth between the different states/versions of a project. In the above scenario, you can create a new branch and test the new feature without affecting the main branch. Once you are done with it, you can merge the changes from new branch to the main branch. Here the main branch is the master branch, which is there in your repository by default.
To create a branch in GitHub, click on main and fill the name of your branch. Am creating a branch called New-branch. Follow the screenshot below. 
![branch](https://dev-to-uploads.s3.amazonaws.com/i/bl5ggxy2ib09k3q4kb0i.png)

**GitHub commands.**
**1. Commit Command**
This operation helps you to save the changes in your file. When you commit a file, you should always provide the message, just to keep in the mind the changes done by you. Though this message is not compulsory but it is always recommended so that it can differentiate the various versions or commits you have done so far to your repository. This is an example screenshot
![commit](https://dev-to-uploads.s3.amazonaws.com/i/v6xzlolc6p49ahy8c9hx.png)
**2. Pull Command**
Pull command is the most important command in GitHub. It tell the changes done in the file and request other contributors to view it as well as merge it with the master branch. Once the commit is done, anyone can pull the file and can start a discussion over it. Once its all done, you can merge the file.
Click the ‘Pull requests’ tab, Click ‘New pull request’, Once you click on pull request, select the branch and click ‘readme- changes’ file to view changes between the two files present in our repository, Click “Create pull request”, Enter any title, description to your changes and click on “Create pull request”. 
**3. Merge Command**
  
 command which merge the changes into the main master branch. We saw the changes in pink and green color, now let’s merge the “readme- changes” file with the master branch/ read-me. Click on “Merge pull request” to merge the changes into master branch. Click “Confirm merge”.
**4.Cloning and Forking GitHub Repository**
Cloning a repository means that you're downloading a copy of the source code from source control. You can clone a repository from GitHub to your local computer to make it easier to fix merge conflicts, add or remove files, and push larger commits. When you clone a repository, you copy the repository from GitHub to your local machine. Above the list of files, click  Code, you can clone the repository using HTTPS", SSH or GitHub CLI. You can then Open with GitHub Desktop or download zip. refer to screenshot below
![clone](https://dev-to-uploads.s3.amazonaws.com/i/ftf647aawibgofh6yhyr.png)
A fork is a copy of a repository. ##Forking## a repository allows you to freely experiment with changes without affecting the original project. Most commonly, forks are used to either propose changes to someone else's project or to use someone else's project as a starting point for your own idea. Go to Explore and search for public repositories. Click “fork”.