There are those who usually copy their projects to other directories as a strategy to maintain backups of progress, but others use smarter solutions and less prone to errors and data loss, they use version control systems.
A version control system allows you to save “photographs” of the status of your project at that moment of time, giving you the ability to restore that status at any time. It’s simple: you take one of these “photos”, you work on your project and if something goes wrong you can go back to some point where everything worked. In this way you will continue working and you can sleep peacefully at night knowing that you have backups of your code at times of time where everything works.
These are common actions for several version control systems, but for some reason Git is a favorite of many. Surely you will ask yourself: why did it become so popular? Well, Git came to bring a number of novel features that make the lives of all developers easier.
DISTRIBUTED, NOT CENTRALIZED
Most version control systems use a centralized server to save all changes and updates. This feature is wonderful because it allows people in different parts of the world to work on the same project, however it is strongly tied to the Internet connection to work, otherwise the changes can never be reflected in the central server.
Git is presented as a distributed system, in which all nodes handle the information in its entirety and therefore can act as a client or server at any time, that is, the concept of “centralized” is eliminated. This is achieved thanks to the fact that every time you synchronize the changes with the Git remote repository, it saves you an entire copy of the data with all the necessary structure and files. So it is no longer necessary to go online to check the historical changes on a file or to see who was the last person who edited it, everything is done directly on your local copy and then, when you consider it appropriate, you can send those changes to the remote repository
PHOTOGRAPHS, NO DIFFERENCES
The most popular version control systems store their data as a set of differences from the original version of a file, in other words, they keep only a list of changes over time over the initial version.
Git rethinks this methodology and is closer to what would be the operation of a file system, saving over time a new photograph that encloses the current state of the file with all its changes. However, Git is quite intelligent because when a file does not change, instead of saving the same photo several times, it saves a reference to that photo. This optimizes system resources.
CHECK, CHECK, CHECK
Git checks everything, so it is impossible for a file to get corrupted or lost without knowing it. These verifications are made by means of a checksum known as SHA-1 and are integrated into the depths of your being. The changes, the files, almost everything is stored in Git not by name, but by the checksum of its contents.
IT’S FAST (AND FURIOUS)
As we mentioned above, Git allows you to work everything locally because it is a distributed system. You do not need to go online to check historical changes and much less to confirm the most recent changes you have made, everything is done against your local database. This allows you to work on the train on the way home or while crossing the Atlantic on an airplane, it also speeds up all operations and allows branching things, so expensive in other systems, with Git to be a matter of milliseconds.
ADD BUT DO NOT DELETE
Another of Git’s fundamental principles is that of not removing information. When you make a change to your project, simply add more information to the repository, which makes it very difficult to spoil something by mistake or that you cannot undo those modifications. Like all version control systems, with Git you can lose information that you have not yet confirmed, but once this step is done, everything will be saved and you can safely undo it.
Git has somehow revolutionized the world of software development. Although it presents a paradigm shift with respect to the most common solutions, its benefits are worth the attempt. In addition, it is Free Software distributed under the terms of the GNU General Public License version 2. And you are already using Git?