What is git and why is it so widely used?
git is a very powerful version control system, but it's not the only one. You may have heard of mercurial, subversion, CVS ...
In simple and practical terms, it solves two very real problems:
- how can I keep track of the codebase I am working on
- how can I collaborate with other programmers/engineers/data scientist making changes on the same piece of code
Some examples and use cases:
- As an engineer I want to see what changes were made to this code (when, who made them), and I want the ability to go back to a previous version if needed
- As a data scientist I want to share my code with my colleagues and implement their suggestions efficiently.
It’s not surprising that version control and git in particular is critical part of many Open Source projects, including Python!
Imagine a very large number of people in different countries, in different timezones, working together on the same piece of code.
Also, it’s not a coincidence that git was created by Linus Torvalds, the same person that gave us Linux!
Another important point: git is not GitHub!
git is the control version system (the software). As it’s open source you can install it on your machine, or on a server, and share your repository with as many people as you like, granted they can connect to it.
GitHub is a commercial platform that provides git and a nice web interface and other useful features (GitHub actions, dependabot), and also offers a free tier. But it’s not the only one. You could also try GitLab, Bitbucket, Launchpad …
YouTube Git vs. GitHub: What's the difference?
There are plenty of free resources online to get more advanced knowledge of git, so I will just leave some pointers here that hopefully will get you up to speed in a short time.
Basics and some reference pages:
- https://www.atlassian.com/git/tutorials/what-is-git
- https://guides.github.com/activities/hello-world/
- https://www.freecodecamp.org/news/what-is-git-and-how-to-use-it-c341b049ae61/
- YouTube freeCodeCamp Git and GitHub for Beginners - Crash Course
Beyond the basics:
- https://realpython.com/python-git-github-intro/
- https://realpython.com/advanced-git-for-pythonistas/
- https://dangitgit.com/en or "how do I ..."
Most modern IDEs support git out of the box