🛠️ What Is GitHub?

GitHub is a service that enables developers to store their code virtually

Kieran Witt
TheLeanProgrammer
4 min readMay 9, 2021

--

What is GitHub used for:

Developers use it to share and collaborate on code they’re working on and keep track of the most current version of the code. They do this by loading it to a repository. Developers could be using it to show their code to the world (like me), ask for feedback from the wider developer community, or share it with their team who are working on the same project simultaneously.

What are the benefits:

🤝 It makes it easy to collaborate: Using GitHub is free and includes features like a wiki and issue tracker that makes it easy to explain, manage and get feedback about your project. It even enables you to contribute to a project you don’t own by letting you fork a project, make your changes and then send them a pull request using the GitHub website.

🗃️ Efficient code management: Every change to some code stored in a GitHub repository is tracked for changes noting who made what change and when. This enables individual developers to keep a log of all the changes they’ve made just in case they break something and need to revert it. It also enables teams to collaborate effortlessly because everyone can see the history of the code.

🕹️ Remote hosting: GitHub repositories are in the cloud, meaning there is no longer a dependency device your code is written. For example, without using GitHub, my code would be stored on my laptop. If my laptop was to blow up, I’ve lost my code along with it.

Showcasing your work: As of January 2020, GitHub had 40 million and more than 190 million repositories. This is a huge audience of developers, some like me just starting but a great deal more that are established developers and many businesses. A GitHub profile is a window into your experience and capabilities as a developer and could benefit any future job hunt. You can also explore other people's work, either searching them directly or looking at what’s trending on the explore page.

Core concepts to understand:

Repository: sometimes referred to as a ‘repo’, is a central location where data is stored and managed. In the context of GitHub, this data is code. Repositories are used to organize single projects.

Commit: A commit is a record of changes made to the files in GitHub. It enables version control management. You are said to commit changes to GitHub when you upload revisions to code in a repository. Commits track who, what, and when code has changed, so you can always find out the history of the code or if you need to, reverse a change. The tool that manages this information

Branch: A branch is a version of a repository. It branches off the main repository hence the term branch. Branches enable you to work on changes to the latest version of code (called the master branch) within a repository without affecting that code. When your changes are ready, you can initiate a pull request. Think of it like a train track; by creating a branch, you’re creating a bit of track that branches off the mainline to run alongside it.

Photo by Roman Synkevych on Unsplash

Pull Request: A pull request is a way of telling you to tell other developers, normally an owner of a repository about changes, you have made to the code in the repository on a branch and that you’re ready for them to be merged into the main code. Going back to the train track analogy, this is like you redirecting the track that’s running alongside the mainline to connect back in. Once it’s connected (merged), the branch disappears. Owners of the repository can decline your pull request.

Merge: In the context of everything else, this one is quite simple. It’s the act of connecting a branched version of a repository back to the main repository. In doing this, the code in the branch that has been changed supersedes the code in the main repository.

Fork: A fork is when you make an independent copy of a repository. Doing this allows you to experiment and alter the original repository code without affecting it at all. Unlike a branch, you copy the original repository and all of its branches when you create a fork. A fork creates an independent copy of the repository in its entirety, so if the original repository is ever deleted, the fork will remain. Going back to the trains… this is like saying I like that set of track over there. I’m going to make an exact copy of it over here.

Thanks for reading 🤟

📌 Follow me on Medium and Twitter for more like this.

🏗️ Head to my website to find more projects and their source code.

Don’t forget to follow The Lean Programmer Publication for more such articles, and subscribe to our newsletter tinyletter.com/TheLeanProgrammer

--

--

Kieran Witt
TheLeanProgrammer
0 Followers

By day I'm a product and project manager in the financial sector. By night I write about my ideas and journey to learn code.