Git version control -Part 1

Git version control -Part 1

What is Git?

Git is a distributed version control system (VCS). A version control system is a tool that allows developers to manage changes to source code over time. It keeps track of all the changes made to the code, and provides the ability to revert to a previous version of the code if necessary.

Git is considered a distributed version control system because it allows developers to work on the code from their own local copies of the codebase, rather than a central, shared repository. This allows for greater flexibility and collaboration as each developer can work independently of others, and the changes can be later merged.

Git provides several features that help developers to manage and collaborate on their code, such as:

????A system for creating "snapshots" of the code at different points in time, so developers can switch between different versions of the codebase.

????The ability to collaborate on code with other developers. Git allows multiple developers to work on the same codebase at the same time, and it provides tools to help them merge their changes.

????A method for keeping track of the history of the code. Git allows developers to see who made changes, when they were made, and why they were made.

Git is widely used by developers and organizations all over the world, and it is a powerful tool that helps developers to collaborate, manage and track the changes to their code. It can be used for many types of projects, big or small, and its popularity have led to many Git-based hosting and management platforms such as GitHub, GitLab, Bitbucket and etc.

What is difference between Git vs SVN?

Git and SVN (Apache Subversion) are both version control systems, but they have some key differences in how they function and how they are used.

·????????Distributed vs Centralized: One of the biggest differences between Git and SVN is that Git is a distributed version control system, while SVN is a centralized version control system. This means that in Git, developers have a local copy of the entire codebase and its history on their own machine, and they can commit changes to the codebase directly to their local repository. In contrast, SVN stores a single, central copy of the codebase that all developers share, and they must connect to the central repository to commit changes.

·????????Branching and Merging: Git is designed to handle branches and merging in a more efficient way compared to SVN. Git allows developers to create branches for new features and merge them back into the main branch when they are done, this makes it easy to work on different features at the same time, and it's easy to discard the changes if needed. In contrast, SVN uses a copy-modify-merge workflow which can be more complex and less flexible.

·????????Commit Integrity: Git uses SHA-1 hashes for commits and it creates a unique hash for each commit, this allows you

How does the Centralized Workflow work?

The centralized workflow is a version control workflow that is commonly used in centralized version control systems like SVN. In this workflow, all developers share a single, central repository that contains the complete history of the codebase.

The basic process of the centralized workflow is as follows:

1.???Developers check out the latest version of the codebase from the central repository to their local machines.

2.???Developers work on the codebase locally, making changes and committing them to their local repository.

3.???Developers push their changes to the central repository to share them with the rest of the team.

4.???Other developers can then pull the changes from the central repository to their own local machines.

The main advantage of the centralized workflow is that it's easy to set up and it's easy to know what's the latest version of the codebase, it's also easy to rollback changes if something goes wrong.

The main disadvantage is that it relies on a single point of failure, if the central repository goes down, then no one would be able to work on the codebase, it also creates a bottleneck in terms of collaboration, since only one person can work on a particular file at a time, this could lead to delays in the development process.

It's worth noting that the centralized workflow is still widely used, but distributed version control system like Git have gained popularity due to the advantages they offer in terms of collaboration, speed and flexibility.

Sandeep Gurjar

3x AWS Certified | Senior DevOps Engineer | AWS | Ansible | Linux | Terraform | Docker | Kubernetes | Python | Jenkins | Bamboo | Wikijs | IDS/IPS

1 年

Great explanation ?

要查看或添加评论,请登录

社区洞察

其他会员也浏览了