Whether you are new to the coding world or have been coding for a while, you must have heard the word “GitHub.” While some may know about it and be really familiar with what it is and how it is used, others have come across it enough times to know it is extensively used.
If you are one of those, you need not look any further because here I am going to provide you with a step-by-step guide on what GitHub is and how to use it.
Table of Contents:
What is GitHub?
GitHub is basically a version control platform for coders and programmers and is widely used all around the world. In the simplest way possible, it can be described as a platform where a number of coders or programmers come together to work on projects, share code files, branch out their ideas, brainstorm, and make changes in existing files as required.
Kindly go through our explanation video to get a better understanding!
GitHub Terminologies
I bet if you have tried to look up what GitHub is, then you would have stumbled across two technical terminologies, which instead of making things clear about GitHub, just add to the pile of confusion.
So, before we get started with the “how to use” part, let’s get familiar with these two terminologies associated with GitHub.
1. Version Control
Version control, which can also be termed revision control or source control, is a process that helps in tracking and managing the changes made in code files over time.
2. Git
Git is a free and open-source tool to perform version control. It keeps the old versions of the code files even after the changes have been made.
Now that we know what these terminologies mean, it will be easier to grasp the more technical way of describing GitHub, that is, GitHub is a web-based platform that provides hosting service for version control using Git.
Master DevOps & GitHub: Tools, Techniques & Trends
Enhance Your Tech Career with Our DevOps Course
Why GitHub and Why is it so popular?
Well, now we have a basic understanding of GitHub, but there still remains a question unanswered, that is,
Why is GitHub so popular? And Why are programmers so excited about it?
There has to be something that makes it special and different. More and more developers are using GitHub more than any other file hosting service and while the choice eventually comes down to personal preference the reason that they are leaning more towards GitHub is a subject of social dynamics. Let me explain what I mean by that.
GitHub has been supporting and using Git since the early days of when this technology came into the picture. Because of this, it has been able to accomplish some tasks that the other hosting services could not provide.
- For example, if there is a project and some of its files have been edited and changed by more than one programmer or developer at the same time while they were working on it if it were any other hosting service, it would just save the latest changes that were made. Whereas in GitHub all the changes are documented and managed, and this makes working in that case scenario much less prone to confusion.
By the time other file hosting services realized how beneficial git is and how it’s taking over the world, GitHub had already gained more popularity and familiarity among programmers, which in turn built a strong community in GitHub.
Difference Between Git and GitHub
While learning about GitHub you will come across the term “Git” which is commonly confused with GitHub itself by so many people that it has started its own discussions. So, in order to learn more about GitHub it only makes sense that before we move any further with how to use GitHub let’s first clear out any and all confusions between Git and GitHub.
So, here I have listed some key differences between these two. Let’s take a quick look at these, to understand both of them individually.
Git | GitHub |
Git is a tool to execute version control. | GitHub is a platform that utilizes Git to carry out its functionalities. |
It is a software, and to be used it has to be installed. | It is web-based hosting service, so there is no hassle of installation. |
It is a command-line tool. | It provides a graphical user interface. |
Git provides features like the management of edited files. | It has some additional features of its own, like task management, along with the features that come with the benefit of using git. |
After addressing how GitHub is different from Git, let’s get started with GitHub and learn how to use GitHub in detail. I will walk you through the steps one by one, and by the end of this blog, you will have learned all the essentials you need to know about GitHub to get started with it.
Elevate Your DevOps Skills with Free Training Courses
Unlock Your Potential and Advance Your Career with Free, Top-Rated DevOps Resources
Steps on How to Get Started with GitHub
Step 1: Create and set up an account on GitHub
It’s not really any different than creating an account on any other social media platform. Just go to the official GitHub website or click here.
The link will take you to the page, which will look like the following screenshot. Fill up the form and then click “sign up for GitHub”.
Step 2: Creating a repository
Once you have signed up and you are in, it will look something like this:
The next thing that you need to do is create a repository. Before I guide you with that, I know we did not mention anything about the repository before, but you need not panic; we are not going to skip that. I will make that term familiar and clear to you before we learn how to create a repository. So, stay with me.
A Repository is like a storage container or folder for your project. It contains all the project files including all the documents, code files, and other necessary project elements that are important to make, build, and run your project.
Now coming back to “creating a repository,” all you have to do is click on the “new repository,” and it will take you to a new page that will look like the following screenshot.
The only thing left for you to do to create the repository is fill up the fields.
As you can see in the screenshot, you have been provided with the option to choose who can see your repository. By default, it is set to public, which means that by choosing to make the repository public, you are making it available for anyone to view the contents of the repository, unlike in private, where you get to choose who gets to see the content and this feature is available in the paid version.
Also if you want to download the repository to your local system then you can initialize the repository with a README.
After you have filled all the fields carefully, click on “create repository” and voila! You have successfully created and set up your first repository.
Congratulations! You have made it this far!
Now moving further, let me introduce you to some operations to give you an idea of what you can do with your repository.
Let’s go through the following list of some of the basic operations with their respective commands and learn what functionalities these operations provide.
1. Cloning: This operation is used when you want to create a copy of any code file in the public repository.
Command: git clone/path/to/repository
2. Add files: This operation as it is pretty clear from the name adds one or more files to your repository
Command: git add <filename>
3. Commit: When you want to edit or change something in your file and save those changes, the operation you need to use is called Commit.
Command: git commit -m "Commit message"
When you want to edit or change something in your file and save those changes, the operation you need to use is called Commit.
4. Push: Before we learn what and how the push operation is used, we need to know what are branches and master branches in GitHub. So let’s look into that.
Sometimes while working on projects or sometimes over time, you will get different ideas and you will want to try them out without affecting the existing files. This is where the concept of branching comes in handy.
So, branches are basically created to provide you with a safe place or an environment to play out those ideas without affecting the master branch, which is the very first and the repository’s default branch.
Coming back to the push operation!
Push operation sends the changes to the master branch of your repository.
Command: git push origin master
Knowing and understanding all these basic operations is going to help you use GitHub with confidence.
Get 100% Hike!
Master Most in Demand Skills Now!
Benefits of GitHub
Let’s first take a look at the following benefits of GitHub:
- GitHub has made it easy and hassle-free to showcase your projects and applications.
- Being a social networking platform for coders, you can browse and follow popular development projects and get to learn from them.
- It also allows you to make changes and contribute your ideas to your favorite open-source projects available on GitHub.
- And of course, there is the added benefit of being able to track changes that have been made in your codes and files over time.
- GitHub also provides the functionality called GitHub Flavoured markdown which allows you to use a simple text editor to write documents.
- GitHub coming with the facility of Branching has made it so much easier for coders to try out new logic and ideas without changing the master branch, and once you are satisfied with the new changes, you can easily merge them in the end.
- GitHub provides a large community, which means a large number of coders and programmers you can reach out to in case you need help in brainstorming to make your application better, or if you need feedback.
- You can access all these features and create a social network with other coders all for free for your public repositories.
Conclusion
I hope you got to learn about GitHub from this blog and if you would like to learn more about GitHub and its major role in DevOps along with structured training, consider enrolling in our DevOps course.
Our Devops Courses Duration and Fees
Cohort starts on 14th Jan 2025
₹22,743
Cohort starts on 21st Jan 2025
₹22,743
Cohort starts on 14th Jan 2025
₹22,743