Getting Started with Git & GitHub!

Getting Started with Git & GitHub!

·

3 min read

Table of contents

No heading

No headings in the article.

A newbie to Git and GitHub? Want to start learning about it but don't know where to start? Guess what- neither did I had any idea about it! But what if I told you that there's an entire documentation in a sweet and simple language to get you started with this amazing tool...

So what do we understand by the term git? Let's say, you create stunning projects maybe for your organization or college submissions. But how do you store all of your projects in a single place in an organized manner while showcasing them to your fellow friends, colleagues and professors?

Git comes to your rescue- It helps you to organize and store your projects in a single place while creating a written document outlining key details of your projects in the form of READ.ME file. It is an open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. It maintains the history of your project and all of it is stored into the git repository. If you wanna get started with it download it from here on your system according to its requirements. After which you can push your project on GitHub.

So what's the difference? Simply put, Git is a version control system that lets you manage and keep track of your source code history. GitHub is a cloud-based hosting service that lets you manage Git repositories. If you have open-source projects that use Git, then GitHub is designed to help you better manage them.

As you start working with GitHub by making commits in your repositories a main/master branch is created. It is the first branch made when you initialize a Git repository using the git # init command. This seems like an acyclic graph. You can have n number of sub-branches into this while working on a project. Now whenever you are working on a new feature or resolving a bug it is always recommended to create a new branch. Why?- because, lets say you work on 10 new projects using 10 new features, and you commit your changes by adding one feature at a time on the main/master branch itself. Now every time you commit a new change, it will be reflected in the same pull request if incase you make a pull request on the main branch itself, and in this way almost 10 PRs will be created which would create havoc among the users/developers and would find it difficult to review your commits or changes.

If a branch already has a pull request associated with it, it will not allow you to create a new pull request, and all the commits would be added to the same PR. In short, One Branch ---> One Pull Request. So this is why you need to create new branches for every new pull requests.