Last week I started to learn Git. For my career is a crucial tool that as a newbie it needs to be on my portfolio for future projects.
So, in this week’s article, I’ll write about the importance of learning Git, as usual, I broke the article into points so that to me as a writer and to you as a reader will be easier to relate and understand.
- What is Git
- How does it work
- Why should we learn Git
What is Git
Git is a free and open-source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
What is not: it is not GitHub! I think of Github as an extension of Git as it cuts good parts of the Git functions. We could look at GitHub as a website for hosting your projects that use Git. Now that we have this clear let’s move forward.
Git is a type of version control system that creates and helps to track any changes to files. We may say that that Git responds to the following questions regarding editing files:
- What changed
- Who changed
- Why the change
- When the change
Git helps go back to the previous version if we want to.
How does it work
I wrote above that Git is a Distributed Version Control System which means that distributed version control is a form of version control in which the complete codebase including its full history and is mirrored on every developer’s computer. This enables automatic management branching and merging speeds up most operations except for pushing and pulling, improves the ability to work offline, and does not rely on a single location for backups.
I am a visual learner and I like to create in my own words the technical stuff so that I can get a better understanding.
Since my son has a passion for reading books I’ll give an example of how Git works. In time he created his library and has books. One day a friend comes and asks some of his books to add some great content in them. My son agrees and allows him to take them from his library. After a while, this friend brings back the modified copies and my son checks them to see they are what he need and place the books on their belonging shelves replacing the previous, without throw the first version at the rubbish bin, but save them on a lower shelve. One day both of them decide to take a look at the first version, this way, having the possibility to go back in time. In the photo at the beginning of the article, I’ve added, you can check the differences between Distributed Version Control System and Centralised Version Control System.
Why should we learn Git
Most of the companies work with teams and it is needed to have it if you want to increase your chances to be hired as a developer.
It is a useful tool for coordinating projects in teams and also for tracking progress in time by saving checkpoints, similar to a time-travel machine. Among other VCS some alternatives are GitLab, GitFlow, Mercurial, Perforce, and Bitbucket.
Is it also useful for your projects when it comes to save them and have a backup of your work or website(s).
Hopefully you find this article useful and helps you “git” it better. Until next time, happy coding and enjoy the upcoming week.