Table of contents
GitHub is a web-based version-control and collaboration platform for software developers. At a high level, GitHub is a website and cloud-based service that helps developers store and manage their code, as well as track and control changes to their code. To understand exactly what GitHub is, you need to know two connected principles:
To see what is git you can check my other blog about Git. According to statics collected in October 2020, it is the most prominent source code host, with over 60 million new repositories created in 2020 and boasting over 56 million total developers. At the heart of GitHub is Git, an open source project started by Linux creator Linus Torvalds. Matthew McCullough, a trainer at GitHub, explains that Git, like other version control systems, manages and stores revisions of projects. Although it’s mostly used for code, McCullough says Git could be used to manage any other type of file, such as Word documents or Final Cut projects. Think of it as a filing system for every draft of a document. Once new additions to a program are complete, for example, they can easily be incorporated into existing programs.
GitHub also makes it extremely simple to work together on strings of code to really dial in and perfect even the smallest parts of a program. With GitHub, you can collaborate and work on projects with others anywhere in the world. Some of Git’s predecessors, such as CVS and Subversion, have a central “repository” of all the files associated with a project. McCullough explains that when a developer makes changes, those changes are made directly to the central repository. With distributed version control systems like Git, if you want to make a change to a project you copy the whole repository to your own system. You make your changes on your local copy, then you “check in” the changes to the central server. McCullough says this encourages the sharing of more granular changes since you don’t have to connect to the server every time you make a change.
GitHub is a Git repository hosting service, but it adds many of its own features. While Git is a command line tool, GitHub provides a Web-based graphical interface. It also provides access control and several collaboration features, such as a wikis and basic task management tools for every project.
The flagship functionality of GitHub is “forking” – copying a repository from one user’s account to another. This enables you to take a project that you don’t have write access to and modify it under your own account. If you make changes you’d like to share, you can send a notification called a “pull request” to the original owner. That user can then, with a click of a button, merge the changes found in your repo with the original repo.
Is Github Free? How Much It Costs?
With GitHub Free for personal accounts, you may collaborate with an infinite number of people on an unlimited number of public repositories with a full feature set and an unlimited number of private repositories with a limited feature set. The Team plan on Github starts at $44 per user per year.
Who Uses Github?
Github is used by developers, programming instructors, businesses, students, and enterprises worldwide to create millions of open source projects and enable organized collaboration in one platform. It is a collaborative web-based platform with version control systems that offers a more efficient way to build excellent software.
The best feature of Github is that it allows developers from all around the world to collaborate. Open-source solutions, such as GitHub, allow potential developers to participate and share their knowledge for the benefit of the worldwide community.
You can use GitHub to host simple websites for free instead of paying for web hosting elsewhere. This saves you money and gives you more control over your website. However, that isn't the only thing that its code hosting is good for.
GitHub allows you to post code for use or for consideration by other GitHub users. This can be used for remote collaboration with people that you know, or to source inspiration and expertise from users you haven't met. You can also maintain different versions of a piece of code for ongoing testing and development.
Users on GitHub don't only interact through one another's code. There is also an aspect of the platform similar to social media sites. If you select a few interests, GitHub recommends posts by other community members. You can also follow other members and browse "trending repositories."
As of this writing, GitHub has over 55 million users regularly interacting with the platform. In addition to their question-and-answer forum, GitHub is also currently running a beta of a "Discussions" tool that will make the site even more social and collaborative. If the idea of collaborating on code sounds good but the idea of having your code available to everyone doesn't, there is a middle ground. Forming an "Organization" on GitHub lets you share repositories with other users and manage their access on a case-by-case basis. In this way, having an organization on GitHub is similar to having a shared Google Drive. You can also create "Teams" within GitHub organizations. This allows you to set tasks and reminders similar to dedicated workflow platforms.
GitHub is more about giving a helping hand than serving as a crowdfunding site. However, you can help fund other projects and try to get your own projects funded through the GitHub Sponsors program.
GitHub encourages users to sponsor open source projects that they use, often without realizing it, and to sponsor individuals that want to contribute to open source projects instead of projects within companies. There are even developers on GitHub who hope to create open source content sustainably as their main or sole line of work.
-GitHub Developer Environment
One of the most underrated GitHub features is the developer environment, you can use VS Code in the browser.
All you have to do is press the period key or go to GitHub.dev
-GitHub Command Line Interface
“Goodbye, context switching. Hello, terminal.”
GitHub CLI is a command-line tool that brings pull requests, issues, and other features into the terminal.
GitHub Student Developer Pack
The GitHub Student Developer Pack is the most underrated one. This is made for student developers to help them to have hands-on experience with various technologies. Some of their partners Like Canva are so generous that they give 1 year free of cost.
You can have an awesome repo to write more info about you and showcase it as your landing page to GitHub. All you have to do is create a repository with the same name as your GitHub username.
You can easily navigate through files in a repository. Press t in the repository you want to find.
With GitHub Copilot, get suggestions for whole lines or entire functions right inside your editor. You can be more and more productive using this. You can sign up and wait for the approval.
What Are The Benefits Of Github?
It Makes It Easy to Contribute to Your Open Source Projects
To be honest, nearly every open-source project uses GitHub to manage their project. Using GitHub is free if your project is open-source, and GitHub includes a wiki and issue tracker that makes it easy to include more in-depth documentation and get feedback about your project. If you want to contribute, you just fork a project, make your changes and then send them a pull request using GitHub web interface.
By using GitHub, you make it easier to get excellent documentation. Their help section and guides have articles for nearly any topic related to git that you can think of.
Showcase Your Work
Are you a developer who wishes to attract recruiters? GitHub is the best tool you can rely on for this. Today, when searching for new recruits for their project, most companies look into the GitHub profiles. If your profile is available, you will have a higher chance of being recruited even if you are not from a great university or college.
Markdown allows you to use a simple text editor to write formatted documents. GitHub has revolutionized writing by channeling everything through Markdown: the issue tracker, user comments, everything. With so many other programming languages to learn for setting up projects, it’s really a big benefit to have your content inputted in a format without having to learn yet another system.
GitHub is a Repository
This was already mentioned before, but it’s important to note, GitHub is a repository.
What this means that it allows your work to get out there in front of the public. Moreover, GitHub is one of the largest coding communities around right now, so it’s wide exposure for your project.
Track Changes in Your Code Across Versions
When multiple people collaborate on a project, it’s hard to keep track revisions—who changed what, when, and where those files are stored. GitHub takes care of this problem by keeping track of all the changes that have been pushed to the repository. Much like using Microsoft Word or Google Drive, you can have a version history of your code so that previous versions are not lost with every iteration.
GitHub can integrate with common platforms such as Amazon and Google Cloud, services such as Code Climate to track your feedback, and can highlight syntax in over 200 different programming languages.
GitHub does offer private repositories on both free and paid tiers, but even private repositories have their issues. For high-value intellectual property, you’re putting all of this in the hands of GitHub as well as anyone who has a login, which, like many sites, has had security breaches before and is targeted constantly.
GitHub has taken steps to make things more secure (such as the Dependabot addition to GitHub Enterprise), and there are steps you can take as well, but there is still an element of risk that comes with GitHub being cloud-based. This is why some clients and employers will only allow code on their own secure internal Git as a matter of policy.
Some of GitHub’s features, as well as features on other online repositories, are locked behind a SaaS paywall. If you have a large team, this can add up fast. Those who already have a dedicated IT team and their own internal servers are often better off using their own internal Git for cost reasons, but for most the cost isn’t outrageous and GitHub’s pricing has improved (e.g. free private repositories for unlimited users)
How To Use Github?
Anyone can use GitHub's hosting tools and organizational features to organize and host their own project. However, community features and the sponsorship program give passionate users a bigger way to contribute to the open source ecosystem. For the experienced developer, GitHub is a great way to contribute to the space by sharing work and expertise. For the beginning and aspiring developer, getting started on GitHub is a great way to learn more about coding and hone your skills within a dedicated and supportive community. Github can be used via creating and maintaining a repository, beginning and managing a new branch, making changes to a file and committing them to GitHub, and opening and merging a pull request.
Follow the steps below to get started using Git.
Step 1: Install Git and Create a GitHub Account
The first thing you need to do is to install Git and create a GitHub account. There are several different ways to install Git. Follow the instructions below to install Git on your system:
After installing Git on your machine, the next step is to create a free GitHub account.
Follow these steps:
1. Visit the official account creation page: Join GitHub
2. Pick a username, enter your email address, and choose a password.
3. Opt for or opt out of receiving updates and announcements by checking/unchecking the Email preferences checkbox.
4. Verify you're not a robot by solving the Captcha puzzle.
5. Click Create account.
6. GitHub sends a launch code to the specified email address. Copy-paste the code in the designated field.
7. Optionally, enter account personalization details when asked or Skip, and click Continue.
You have now successfully created a GitHub account.
Step 2: How To Create The Repository and Build The Team
To create the repository, we simply used the GitHub web interface and clicked on the
Repositories tab, and then on the
New button. We named the repository
potionfy and We added a short description and a
After the repository was created, we invited Harry to work on it. To do so, we clicked on the
Settings tab in the
potionfy repository, then in the
Manage access option, and finally in the
Add people button. By entering Harry's GitHub username (or email address) in the pop-up window and clicking on the
Add Harry(...) to this repository, we managed to send the invitation to Harry.
He accepted it, and by doing so, both team members were ready to start working on their project.
Step 3: How to create a file
We started the project by creating the initial file the Potionfy SaaS product will use:
In order to do so, we created the file using the GitHub web interface by positioning ourselves in the repository and clicking on the
Add file >
Create new file buttons. Then we added the name of the file, its content, and a meaningful commit message. After clicking on the
Commit new file button, the file was created on the repository.
Step 4: How to create an issue and work on it
We need to move on to work on the marketing related to Potionfy launch, so we told Harry to add a simple landing message to the
index.html file. So, we proceeded to create an issue in the repository by clicking on the
Issues tab and clicking on the
New issue button. After the issue was created, Harry took a look at it (also by going to the
issues tab in the Potionfy repository) and let us know that he will be working on it by leaving a comment and assigning the issue to himself. By working with this dynamic, the team will know who is working on what.
Step 4: How to set up the local development environment
In order to work on the project's
index.html file, Harry chose to work locally, so he needed to clone the
potionfy repository in his development environment (the Linux virtual machine).
The first thing he had to do was set up the SSH keys to work with GitHub. He followed GitHub's Generating a new SSH key and adding it to the ssh-agent tutorial to do so. He then added the key to his GitHub account, following the Adding a new SSH key to your GitHub account tutorial.
Then, Harry opened Hermione's repository on GitHub and copied the link to clone it:
Now in his local development environment, he created a new directory in which all his work would be centralised:
$ mkdir ~/development $ cd ~/development
Finally, he cloned the repository by typing
git clone and pasting the code he just copied from GitHub (which is the address of the repository):
$ git clone email@example.com:Hermione-Colo-Codes/potionfy.git
In this way, he now has a local copy of the repository and he is ready to start working on it.
In order to work on a repository, this is the workflow GitHub recommends:
Create a branch
Create a pull request
Address review comments
Merge your pull request
Delete your branch
Step 1: Create a branch
As it is a good practice not to work on the master branch directly, We created a new branch related to the issue on which he will be working.
We chose to do this on the GitHub repository, but We could have done the same in our local environment using Git commands.
WE chose a meaningful name and prefixed the name with the number of the related issue (which is
1, in this case).
Step 2: Work on the branch locally
After the branch was created, We started working on it.
The first thing we did was a
pull of the whole repository so we could see the branch in our local development environment.
git checkout With the new branch in our environment, we switched to it by using the
git checkout <name_of_branch> command. After doing so, we ensured we was working in the correct branch with the
git branch command.
Solve the issue
We started working on solving the issue. In order to do so, we opened the
index.html file and added a
h1 header to it. After the changes were made, we saw how Git reacted to this change. we then added the file to the staging area with the
git add command and committed the change with the
git commit command. Note how the commit message also includes the id of the issue, which in this case is
Push to the repository
The next step we need to do is to push the changes to the repository.
~/development/potionfy$ git push
Create a pull request
We then clicked on the
Compare and pull request button in the GitHub repository (making sure our branch was selected in the branch left drop-down menu). This pull request will be analysed by others and they will decide if it can be merged to the master branch or not.
I hope you liked my article about Github...