(Very) Basic Concept of Git

Haydar Ali Ismail
3 min readJan 21, 2017

--

Photo is made by Frantzou Fleurine.

For someone who worked on software development, most probably you will have heard about Git. Git is one of the most popular Version Control System (VCS). Using Git we can work on a project either individually or in a group, creating records for everything we have done, and also easier syncing between codes from multiple developers.

Introduction

The first time I know git, it just feels weird. It’s pretty hard for me to understand the whole concept and how to work with Git in my early days. The fault that I did that time was to install a GUI Git application. Yeah, it helps in some ways, but the problem is that I didn’t understand at all about Git. So, if you really want to know how to work out with Git, ditch all of your GUI application for Git.

Today, we are not going to talk about how to use it. Instead, we are going to briefly introduce you to some important terminologies in Git.

Commits

Commit illustration

Commit is the main core of Git. A commit is basically a set of changes in your project. It may consist of adding new files to the project, changing files, deleting files, adding a directory, etc. In real projects, we usually create a commit whenever we finished building a feature, fixing a bug, or anything that can be marked as complete.

Most occurred error by early adopters is that they work on multiple features on that day, and at the end of that day they create a single commit for all of them. It is not a best practice because the benefit of using VCS is that we can track for everything we have done to the project and it is better to commit as much as possible rather than to have less commit. Less commit means that it’s harder to track at which commit you create a feature, fixing bugs, etc.

Branches

Illustration of branches in Git

The easy way to visualize Git is to imagine a tree. A single tree can hold multiple branches and this is what Git means to us. So, a single project can have multiple branches of certain conditions of the project. There is no formal way to define the list of the branches. However, most projects that are using Git have at least two main branches: master and dev.

What does it mean by certain conditions of the project? Let’s say Developer A developing new feature on dev branch, then he creates a disastrous bug in the project. Thus, the project that exists on master branch doesn’t influenced at all and we can easily fix the problem without destroying the project that released to the public.

Repositories

Multiple Git Repositories illustrated

To enable easy synchronization of code between developers is to store it online. Some notable Git hosts are GitHub, Bitbucket, Gitlab, etc. One thing to note, compared to SVN Git have two repositories: local and remote (the one on the internet, we will get to it in the future). As for now, let’s just say the repositories are used to host and sync the project between collaborators.

Wrap Up

As a developer, Git is a must understand topic. To learn more about it better, I suggest you try it by yourself rather than just reading some tutorials. In the future, we will talk more about how to use helpful git commands. Thanks for reading, have a nice weekend!

--

--

Haydar Ali Ismail
Haydar Ali Ismail

Written by Haydar Ali Ismail

Half Data Engineer, Half Software Engineer

No responses yet