DEV Community

Cover image for 8- What is Git? Why should I use it? What is Github, Gitlab, Bitbucket used for?
Hamit SEYREK
Hamit SEYREK

Posted on

8- What is Git? Why should I use it? What is Github, Gitlab, Bitbucket used for?

We have finally come to the **Git **version control system, which allows you to keep your codes more organized, which we talked about throughout the Advanced Software Development article series. If you've come this far by reading the series, it's fine. If you came directly to this article, I suggest you read the 0- Advanced Software Development article.

Everyone gets errors while writing code. While trying to fix that error, we sometimes try more than one solution that we found on the internet. And, there are times when we crash other parties. In such a case, we may want to restore our project to the state after than applying those trials/solutions. While dealing with all this, it can sometimes be too late when we realize that we are making our project worse.

Of course, these are all memories of when we were unaware of the Git version control system. Fortunately, these problems are now a thing of the past, thanks to Git. Git is very useful for anyone who writes code or who sometimes wants to revert to previous versions.

Of course, this is not the only benefit.

Projects rotting on hard drives are now gone from our lives. We can find the pure version of a module we have written among the versions and use it in our new projects. In this way, we are now able to develop projects faster. Each version of each project we do is kept in the Git system on a regular basis.

While there are version control systems such as Git, Mercurial, BitKeeper, CVS and SVN, Git is the most used version control system. Nearly 43% of professional software developers prefer Git.

Git's contributions to teams are another feature. In cases where more than one person works on the same project, a record is kept of who made what changes and what they did. The desired change can be undone instantly.

In short, using Git for all your projects that you develop alone or with your team will make you a more organized and more practical developer. Because the changes made by any of the team members can be seen by the other members. You can pull the changes made by other developers to your own computer with a single command.

Git is software that works locally. After Git is installed, it is easier to follow the versions thanks to such a Client interface program. Thanks to GitHub Desktop, Sourcetree, Fork etc. desktop applications, you can follow the version controls of the projects you have developed on your own local computer.

Image description

Why should I use it?

There are more advantages to using Git online. In this way, you can access your projects from anywhere, as well as share them with other members of the team very easily. While all members of the team are working on the same project, Git helps you a lot in merging all commits. Online storage systems such as Github, Gitlab and Bitbucket use the Git version control system. On these platforms, you can keep your projects either public or private.

All the systems we mentioned in other articles (Devops, Agile, SOLID, etc.) actually require the use of git. Or we can say that Git makes it possible for such systems to work. Because growing projects as a single module does not comply with any software development principle. Git both encourages modularization and makes it more feasible. Projects developed by large teams are shared among team members in modules. Thanks to Git, multiple modules of the project (interface, registration form, api, basket part, payment modules, etc.) can be developed by different people in parallel.

When changes made in teams where Git version control is not used are added to the main project, things do not always go as desired. For example, when your customer says they don't want module X anymore, it will be very difficult to find all the other modules that that module affects. Thanks to the Git branching system, modules can be removed from the system much more easily.

One of my favorite features of Git is that it gives me the chance to experiment without limit.

I can do all the ideas that come to my mind with the comfort of knowing that I will not break the project. Even though I don't use most of my ideas afterwards, I can sometimes come across something creative. We can say that this comfort has increased my creativity. This comfort can accelerate the development of newcomers, less experienced fellows, as it gives them the opportunity to try things out without breaking them. Because you can undo your mistakes whenever you want. And without a single line damaging the project :)

With Git version control, you can write the commits you have made in an explanatory way. Which change why was made can be easily seen by all team members. When you commit, the Git system not only takes a snapshot of the current state of your project, but also shows you comparatively what has been done down to the smallest detail. Not only does it keep file changes or lines added/removed, it even saves a single space character that has changed in the file. In this way, your progress will be much stronger. The important point here is that when you commit, you should pay attention to a single subject if possible. When you undo multi-subject commits, you may be deprived of more than one change. But a commit with a single feature is more useful for undoing transactions related to only that feature.

Image description

Many companies work offline for security reasons. But in the offline working model, which can be realized thanks to Git, even when a problem occurs on the main server, since each developer has a sub-version, the work can continue without stopping.

Conclusion

Without a doubt, what a developer fears most is data loss. Sometimes we think that we have taken a backup, but we had not get it completely. Sometimes, the backup files we receive can be infected with viruses and corrupt our backups. Data loss is actually the worst thing that can happen to a project. But luckily Git got us out of this trouble as well. In fact, it saved the companies. Because versions of a project are kept on each developer's computer. A user who uses Git has a full-fledged copy on his computer as well as a record of all changes made to the project.

There is a difference between someone who has actively written code or a project that can be referenced in their CV and someone who does not have any work :)

In the article, I touched on why we should use Git. I'll leave it up to you to research how to use it. Don't wait, start now. There is no doubt that using Git will make you a better developer.

In the Advanced Software Development series:

Previous article: "7- What makes SOLID principles special? Are there any other software development principles? What are they?".

Don't forget to like if you think it's useful :)

Always get better...

Top comments (0)