What is Git? Why should I use it? What are Github, Gitlab, Bitbucket for?

git-github-gitlab

Everyone gets errors when writing code. While trying to fix that bug, sometimes we try multiple solutions we find on the internet. There are times when we end up breaking something else. In such a case, we may want to bring our project back to the way it was before we applied those experiments/solutions. Sometimes it’s too late when we realize that we’ve made our project worse while dealing with all this.

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

But that’s not the only benefit.

We no longer have projects rotting on hard disks. We can find the pure version of a module we have written between versions and use it in our new projects. In this way, we can now develop projects faster. Each version of each project we make is kept in the Git system in an organized way.

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

git-svn

Another feature of Git is its contribution to teams. In cases where more than one person works on the same project, a record of all the changes made by whom and what they did is kept. The desired change can be rolled back instantly.

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

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

Why should I use it?

There are more advantages of using Git online. In this way, you can access your projects from anywhere and share them with other members of the team very easily. When 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 Git version control system. On these platforms you can store your projects as public or private.

All the systems we have 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 making growing projects in 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 divided into modules among team members. With Git, multiple modules of the project (interface, registration form, API, cart section, payment modules, etc.) can be developed in parallel by different people.

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

I can do all the ideas that come to my mind with the comfort of knowing that I won’t break the project. Even if I don’t use most of my experiments later, I can sometimes come up with something creative. We can say that this comfort increases my creativity. This comfort can accelerate the development of less experienced friends who have just joined the team because it gives them the opportunity to try things without breaking them. Because you can undo your mistakes at any time. Without damaging a single line of the project 🙂

With Git version control, you can write the commits you have made in an explanatory way. All team members can easily see which change was made and why. When you make a commit, the Git system not only takes a snapshot of the current status of your project, but also shows you comparatively what has been done down to the smallest detail. Not only does it keep track of file changes or lines added or removed, but it even records a single space character that has changed in the file. In this way, your progress is much more robust. The important point here is that when you make a commit, you should pay attention that it has a single topic if possible. When you undo multi-topic commits, you can be deprived of multiple changes. But a single-feature commit is more useful for undoing transactions related to that feature only.

Many companies don’t accept working offline for security reasons. But with Git, even if there is a problem with the main server, work can continue without stopping because each developer has a sub-version.

Conclusion

There is no doubt that a developer’s biggest fear is data loss. Sometimes we think we have a backup, but we don’t have a full backup. Sometimes the backup files we take can be infected with viruses and corrupt our backups. Data loss is actually the worst thing that can happen to us in a project. But fortunately Git also saved us from this trouble. Actually, it saved the companies the most. Because the versions of a project are kept on every developer’s computer. A user who uses Git has a full-fledged copy as well as a record of all changes made to the project on his/her computer.

Find out about GitOps Tools: https://devopstipstricks.com/top-gitops-tools-for-enhancing-your-devops-workflow/

2 thoughts on “What is Git? Why should I use it? What are Github, Gitlab, Bitbucket for?”

Leave a Reply

Your email address will not be published. Required fields are marked *