Understanding GitHub in a Nutshell | Part 1

Understanding GitHub in a Nutshell | Part 1

In the Last Article about Git and Github we Brefily compared the difference between them. Now it's time to see about each of them In detail, Let's start with GitHub. The Web applications which powers the entire open source community, and developers, how did It start and how to become a part of it.


This is the second part of the Github and Git Series. In this article, we shall see about How to create our First Repository, how to commit changes, and how to fork a repository to it.

What is GitHub?

GitHub was developed in 2008 using Ruby on Rails. Now it is maintained by Microsoft. It is a web application where developers around the world can keep/store their applications. This type of application is known as open-source technology where anyone from around the world can contribute to it, Learn about Open-source technology in the article here Most Powerful Version Control Tool and Open-source Community. As soon as Github come into existence the whole industry has changed, in traditional ways where big companies like Google, Netflix, Facebook used to make applications but the source was not available to everyone.


Not only this company any software which was made was not made public, thinking about security and privacy issues which can lead to exploitation of the software. But when Github came it introduced a new term Open-source which was not accepted by many application developers but soon became popular. The reason behind this is because when people from all over the world contribute to an application or software, with different approaches finding the best approach becomes easier.

So it's important to know about this technology and learn how to use it for enhancing our skills and also contributing to the open-source community. The first step to start the process is to make a Github Account. Goto to the official page of Github and create a new account.

What Can we do with GitHub?

For this Let's understand How Github Works. After you have created your account you can see your profile page. Github has a functionality called Repositories, Think this as some kind of folder, Each folder has the whole code for a specific application. We shall be creating a Repo for showing you how to create one. The first step is goto to your profile page, then click on repositories. 


So as you see in the picture navigate to the Repositories section and click on the New Button. Then you need to name your repository, you can make the Repo private or public. If the Repo is made public everyone can access it and see the application code, if the Repo is private no one apart from you can see the code.


So I have named the Repo as myFirstRepo and also made it private as this is only for articles. You can add additional features like adding a Description, readme.MD file, adding a license, which is not as useful for not. Then click Create repository and the Repo will be created in your library. Now let's also add some files to the repo and commit it. Commit is nothing but saving the changes done to Repo Goto your Repository and click on ADD File button which will prompt you to select the file which you want to upload.



In this case, I uploaded a python file that checks for even or odd numbers. Then you can add a description for this commit and name too, at last click on Commit changes then changes will be reflected on your repository. There you go, You just created your first commit and Repository. But sometimes The code which we want can be in another Repo, In that Case how to get the code.

How to Fork a Repository in GitHub

Forking is the functionality that Github provides for the above question of copying other's Repo. Whenever you want to copy the repository of someone else, then you can simply fork the repo and all the files will be added to the copy of the repo in your account. Let's see this with a simple demonstration, for this, we shall be forking the Linux Repository. First let's search the Repo in the search bar goto the first repository, or this link Torvalds/linux. This is the Official Repository created by Linus Torvalds for the Linux operating system.


Click on the Fork Option on the top right side of the Repo name. Then you can see that the Repository has been added to your library but there are some points to remember here.

Points to remember while Forking A Repo

  • Whenever you fork a Repo from another's library, and if you do some changes to the repo in your library then the changes will not be reflected in the Parent or original Repo. The Changes will only reflect in the copy of the Repo which is there in your library.
  • If you want to Commit the changes in the Original library then you need to make a push request which the author of the original Repo should accept. This is also known as Contributing to a Repo, We shall see this in detail in the Upcoming Articles.
  • The author of Original Repo will have the track of people who have Forked the Repo.
That's all for this Articles, Stay tuned for the Next Article

1 Comments

Previous Post Next Post