Sitemap
Dilini Navodya

Dilini Navodya

Version Control Using Git & GitHub

4 min readMay 15, 2022
Press enter or click to view image in full size

In this blog, I hope to discuss an important concept known as version control, which is important to all types of developers. Aside from that, you’ll understand what git and GitHub are and their benefits.

Version Controlling means?

Monitoring changes in order to appropriately manage them is the most basic and straightforward idea. This is useful when working with a team or specific people during the development process. It helps us relax and see the improvements we’re making in a stressful circumstance. This promotes team collaboration and communication while also making the code easier to manage. Every modification we make is visible to other developers, helping them to better understand what has changed and who did it.

Let’s see what the benefits are using version controlling

· Efficiency

· Branching And Merging

· Identity

· Traceability

· Reduction Of Duplication and Errors

Let’s see what the importance are using git

Version control systems are divided into two types.

· Centralized version control systems

· Distributed version control systems.

The fact that git is a distributed version control system is one of the most important aspects of utilizing it. There were several centrally managed systems like CVS before git. The phrase centralized means that each user receives a copy that points back to a central repository. In git, each user has their own repository with a complete history of commits.

Basic commands what we use in git

To begin working with git, we must first configure the user data. As a result, we can customize our data to make ourselves more identifiable. The commands below can be used to complete this task.

Press enter or click to view image in full size

We can enter our own name for the place “YOUR_USERNAME” in the previous code snippet. Similarly, we can send out our e-mails also.

Press enter or click to view image in full size

Setting up a new repository

Get Dilini Navodya’s stories in your inbox

Join Medium for free to get updates from this writer.

This is one of the most important commands to learn while dealing with git. We can set up our git repository with the command below.

In the local file system, this command will establish a new git repository. In actuality, a “.git” file has been generated in the root of the file location, which will contain all of the information needed to track changes.
When it comes to file modifications, git makes it simple to keep track of everything. We may generally separate the files into three stages.

· Modified — Made some modifications, but they are not permanent

· staged — Made some modifications and is prepared to commit during the next commit

· Committed — Saved the modifications locally

Following is the command we used to clone repository.

To check the status, we use the command git status, which displays the modified files in the current directory. This will expose whether there are any untracked changes in the repository that have to be committed. Otherwise, it will say that the repository is up to date.

If anything needs to be added after we check the status, we can use the following commands. One method is to add a particular file by name. The other option is to use the command “git add.” to add all of the files.

To commit all changes that we have done, we can use this command

Let’s see what GitHub is

Press enter or click to view image in full size

GitHub is a software development and version control platform based on Git. The git distributed version control and source code control features are provided by GitHub. It’s simply a code sharing and management platform. This has proven to be incredibly beneficial and popular because it simplifies project management and collaboration with others for both developers and major corporations and organizations.

So, these are the fundamental commands; if we’re using a site like GitHub to host our git repositories, we’ll need to know a few more. Git branch, git push, and git diff are a few examples for this.

Thank You!

--

--