What Is GitHub?

Sebastian De Lima
The Startup
Published in
4 min readJul 6, 2020

A brief explanation of GitHub and it's most used features

Introduction

Humans have always thought of ways to connect and to work together as a team, over the years we have created new ways to connect virtually allowing us to work together without having to worry about the distance. Applications like Facebook and Twitter are now indispensable for us. Almost all video games allow you to play online with friends or strangers from all over the world. GitHub is another one of these pieces of software that allow people to connect and work together in a more efficient, fast, and dynamic way. In this blog, I will explain how GitHub works and the different things that we can use it for.

How it works

GitHub -in simple terms- is just a space or a cloud if you will where you can save, share, and edit files simultaneously with someone else. Every file, files, or whatever project that you save into GitHub is called a repository or “repo”.

Imagine that you work at Netflix as a product manager and one day you realize that you want to make changes to the homepage. You talk to the developer team and you explain all the changes that you want to do. Let’s suppose that all the code for Netflix is saved on GitHub in different files. The lead developer would then divide the task into different chunks and send the instructions to each developer. It would be very difficult if everyone was working on the same files right? One of the main features is being able to create a copy of the repo and have it in your computer that way if you write code that doesn't work then it won't affect the program because you would be working on a copy of the project, this is called cloning a repo.

Branches

At this point, you have an exact clone of the Netflix code in your computer and you are ready to start working on the new feature the first thing that you should do is create a branch. A branch is another copy (of the copy) where you can work, the benefit of branching is that if you mess something up you can always go back to the original copy and start again.

Here is a great example of branching, we can see that the green segment is the main copy or master, then the blue segment is the branch that is not yet part of the green segment or main part. See that the blue segment at one point joins the blue segment? This is called merging. It’s very important to understand why the segment is made by little circles, each circle represents a save called commit, say that you are 30% done with the new feature but you want to keep working another day so you commit your changes(you save them), each commit will save the name of the person who did it and it will make it possible to always return to those checkpoints. Maybe you decide that you want to change what you did so, you can always go back to these commits or checkpoints and find your previous saves.

Merging

Merging is when you add the changes that you made to the master branch. Say that you are finished with the new feature, now you need to join all the code that you wrote into the main copy so that you can then join all of it to the project. This step will automatically change all the code in the main branch and it will add all of the changes that you did in the branches joining both the code that was before with the new code that you modified.

Merge pull request

You have worked hard to create the new feature, you have tested it and made it perfect and you are ready to incorporate it to the project, here is where you would do a pull request. It is called “request” because you are requesting to add your changes to the main project. Each repository has a writer or owner, this owner is the only one that can accept changes from other people before they get added to the project. Your pull request will be seen by the owner, in this case, the lead developer. He will then see all of the code you wrote and test it if it works; Then he will accept your request and all of your code will now be added to the real project.

Conclusion

GitHub is a great tool that allows developers to work in a more efficient and organized matter. GitHub is so important that it is even used by employers to see the quality of a candidate’s code. I hope this blog helped you understand the concept and logic of GitHub, there are a lot more features that GitHub provides like hosting a website or following others to see their content. Thanks for reading!

--

--

Sebastian De Lima
The Startup

Programmer, Catholic Missionary, and proud boyfriend of the most beautiful girl in the world.