GIT - What is it?
I recently had the opportunity to learn Git and, through that, to support developers by managing iterative updates to source code for continuous integration and continuous deployment. Using a number of varied resources I learnt many aspects of Git, including what it provides, how it processes information, and Git commands required to complete tasks.
What is Git?
Git is a version control system, used to manage source code. It is command line based and installed on local systems. If you have heard of Git then you will likely have come across GitHub and GitLab. These are Cloud based hosting services for Git repositories, with a graphical interface allowing for a more accessible management of Git repositories.
How is Git used?
Git allows multiple users to work on the same code simultaneously without any limitations. Users can pull a copy of code from a Git repository to their individual local systems, make changes to different lines within the code, then commit and push code to the Git repository.
The different copies of code can then be merged together to create a single version. If there are any conflicts, where more than one user has updated the same line of code, this will be highlighted by Git, allowing the appropriate line of code to be accepted to fix the conflict.
Any new users are able to clone the Git repository to get the latest version of code and continue to work from the same iteration as all the existing users. Git provides the capability for continuous integration and continuous deployment, branches can be used to manage different iterations of development. Allowing changes at different iterations to be tracked and code to be reverted back if any issues are found.
Once an iteration is ready, a tag can be created as a reference point with accompanying release notes. This can then be used to deploy the iteration to the relevant environment for testing.
Benefits of Git?
Git provides distributed version control, allowing code and its history to be mirrored to all users' computers. Compared to centralised version control, where only the code is mirrored.
Local and remote repositories are utilised, so code can be updated on local systems and its history will also be updated, which can then be pushed onto remote repositories. You can work on local repositories without any internet connectivity.
Git supports projects of all sizes and is scalable with project growth, it is open source and free. All these aforementioned benefits result in faster results.