What is Git?
Git is the most widely used Version Control Control System in the world. It was developed by Linus Torvalds in 2005 as a way to address the challenges of remote development projects and the multiple conflicting updates that can occur during the development cycle as a result of developers not working closely together.
A Distributed Version Control System is a platform that allows developers to work on programs remotely as their own separate versions, then merge their changes into one master file once the developer feels changes are ready. In Git projects, there is a master project that a team is trying to develop and improve. But instead of everyone working on the master project itself, each developer can download a copy, make changes in a completely separate environment from other developers, then merge those changes into the master version which can then be globally updated for all developers to download from.
When developers work on these separate versions of an application (known as branches) those changes are not going be seen by other developers until integrated into the master file. Each developer has their own version and their own repository of changes. This is useful because if a developer feels they need to make revisions or restore an old version, they are free to do so.
By working on a separate version of an application, developers aren’t disturbed by changes from another developer. It also allows developers to test their specific changes in a program to see if issues arise or they want to make corrections before integrating those changes for everyone else.
Example of Version Control
How Version Control Branches Work
In this illustration, there is an app that is going through 3 stages of development and being worked on by 2 developers.
John (developer 1) downloads App version 1 and makes several changes to it. He doesn’t disturb Dave (developer 2) who is also working on the app because both have separate version repositories after they’ve downloaded from the master project.
John makes several changes to the app and then reverts 1 step because he made an error before resubmitting his changes to the master app. John can do this with ease because Git backs up John’s app versions along the way. He ends up submitting version 3 from his repository instead of version 4.
Dave only needs to make 2 changes. He works undisturbed then submits his changes to the master project.
After both developers have submitted their changes, the master project is updated to App version 2.
Both developers are now working from a new version (App V2) where they are both up to date on each other’s work.
They review their changes. Dave finds he doesn’t need to make any more changes, so he submits App V2 as the final version. John, on the other hand, realizes there is an error and fixes it in his copy of App V2. He then submits the changes to the final version.
Because both developers were using Git, John was able to submit his change to the final version and Git recognized Dave didn’t submit any conflicting changes and so the change was implemented in the final project.
Advantages of Using Git:
Scalability: Git is a powerful tool that allows multiple developers to work on applications remotely. Git is relied on from small development teams to large, multi-national tech corporations.
Built-in Backup: Git is built with recovery in mind. versions are saved all along the way and repositories are separate so if a developer wants to return to an old version they can.
Centralized Development: Git projects can be enforced by an admin so that no one is pushing changes to the master file before approval. This helps foster organization and managed collaboration.
Genuine Details: details like time, file ID, commit messages, and anything else stamped by Git cannot be changed without changing the file ID itself. This means details are authentic.
Speed: most operations in Git are performed on the local machine that the developer is working on. This means there is no latency or performance drop that sometimes comes from communicating with central servers.
Open Source: Git was developed by Linus Torvalds – the creator of the Linux kernel. Git is open source so the community can contribute and modify the program as they wish.
Free: Git is a free platform that allows developers of all sizes to use Git to build projects affordably.
Optimized for Linux: Git was built by Linux Torvalds who developer the Linux Kernel. git was designed to be a tool optimized for Linux development environments.
What is GitHub?
Many people in the technology community are more familiar with Github than with Git itself. And you might be wondering what the relationship between the two is.
Github and Git are separate entities. Git is the development platform that allows for Distributed Version Control while Github is a company offering an online development community where users can submit Git projects along with other development projects.
GitHub, recently purchased by Microsoft in 2018, is a hub targeted at the developer community. It allows developers to share code, projects, collaborate on forums, ask questions, find featured tools and software, learn about open source guidelines, and more.
For example, when clicking the “Android” topic, users can find anything from designers asking questions about Google’s material design, sharing resources that they’ve found helpful for general Android programing knowledge, and curated collections of software or interesting projects.
Just like Git, Github is built on the premise of community and collaboration. It is designed for developers to have a forum to discuss, collaborate, and share.
What’s The Connection Between Github and Git?
While Github is more than just Git projects, it is still designed to work seamlessly with Git. Git projects are typically published and stored on Github as a way to centralize them project. From there, developers can “pull” a project down from Github and begin working on their own branch. When they are ready, it can then be “pushed” back up to Github and integrated into a downloadable master file.
While many users of Git are users that share their projects to the public, Git offers the choice to create private repositories that act much like a storage locker for projects. This is a great system for remote developers looking to collaborate as Git acts as a safe space to store a development project. Private repositories are also heavily used by large corporations looking for a way to unite their remote workforce.
Summary and Final Thoughts
For many developers worldwide and of all sizes, Git is an irreplaceable tool and the defacto standard when collaborating on large development projects with many distributed versions. The fact that Git is free and open-source means that developers of all sizes can take advantage of Git which allows for coordinated, remote development.
Git is scalable, recoverable, and centralizes workflows between developers making it an essential tool for the modern remote cloud computing dominated world. Developers can work on their own machines for speed, then push their creations to repositories in the cloud through services like Github or private cloud servers for internal organization use. Git allows for seamless development on the Linux platform but is available to be used on all platforms giving it unparalleled flexibility.
If developers decide they want to collaborate openly on projects, they turn to a platform like Github where they can share their development, collaborate, ask questions or find resources through the many forums and curated lists by Github users.
If you want to try Git yourself, the Git website has details on how to install Git. There is also an optional GUI desktop program to install.