GitHub

 

GitHub

is a cloud-based service/platform that allows programmers or software developers to manage and store their code. Users can even track and control the changes they made to their code. GitHub is mainly used to share users' code and to collaborate on shared work. Multiple users can collaborate on GitHub to develop a single software or program. GitHub offers free service to it's individual or team users for public repositories and upto 500GB of storage and 2000 actions for private repositories (you will fully understand this once you are done reading the entire blog post). It also supports a command line version to manage everything.

A few key terms and concepts to fully understand GitHub are:

Repository

It is a location where all the files for a particular project are stored. It is like a folder on a computer. Each repository can be accessed using a unique url. 

First thing that a user needs to do to use GitHub is to create an account:

  1. Go to Github.com and click on sign up, on the top right corner of the page
  2. Enter the required information and click on Create account




Create a Repository:

  1. Go to Github.com and log into you account
  2. Click on +, in the upper right corner and select New repository
  3. Enter a name and discription for the repository
  4. Check Initialize this repository with a README 

Branch

Branching is a way to work on different versions of the repository at a time. By default, there is one branch (main) when a new repository is created. Branch is used for experimenting or working on a part of the project before adding the changes to the work to main branch.  

How to create a branch:
  1. Go to your repository
  2. Click the drop down at the top of the file list that says branch: main.
  3. Type a branch name into the text box.
  4. Select the Create branch box or hit “Enter”


Commiting a change

Saved changes are called commits on GitHub. Commit captures the history of your changes, so other contributor can know what someone has done and why.
  1. Click on a file in the repository
  2. Click the pencil icon in the upper right corner of the file view to edit
  3. Write a commit message that described the changes
  4. Click on Commit changes button 


Pull request

Pull requests are the most important part of the collaboration on GitHub. When a pull request is opened, you're proposing your changes and requesting that someone review and pull in your contribution to the project and merge them into their branch. The differences and changes - additions and subtractions are shown in Pull requests in green and red.

How to open a pull request:
  1. Click the Pull Request tab and then click the green New pull request button on the Pull Request page. 
  2. Select the appropriate branch and look over the changes in the differences on the compare page.
  3. Once satisfied, click the Create Pull Request button.


Merge a Pull Request:

Finally, it's time to bring your changes together - merging your branch into the main branch. 
  1. Click the Merge pull request button to merge the changes
  2. Click Confirm Merge


And you are done! GitHub is a very convenient solution for collaborating on a programming project and is widely used by most companies, professionals and students all over the world.

Comments

Popular posts from this blog

GroupMe

Google Suite (Docs, Sheets, Slides)

Microsoft Suite Overview