VERSION CONTROLLING
What is version controlling?
Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later. It allows you to manage changes to files over time and multiple developers, designers, and team members to work together on the same project. You can use version control to version code, binary files, and digital assets.
Version Control System (VCS) is a very wise thing to use. It allows you to revert selected files back to a previous state, revert the entire project back to a previous state, compare changes over time, see who last modified something that might be causing a problem, who introduced an issue and when, and more. There are several types of version control systems that teams use today. Some are centralized. Some are distributed.
Few of the most popular types of VCS:
Why version control system is important?
Version control is important to keep track of changes and keep every team member working off the latest version. You should use version control software for all code, files, and assets that multiple team members will collaborate on.
Use of Version Control System:
- A repository: It can be thought of as a database of changes and contains all the edits and historical versions of the project.
- Copy of Work (sometimes called as checkout): It is the personal copy of all the files in a project.
Benefits of version control system:- Complete change history of the file
- Simultaneously working
- Branching and merging
- Traceability
Types of Version Control Systems:
- Local Version Control Systems
- Centralized Version Control Systems
- Distributed Version Control Systems
Local Version Control System
Local VCS is an approach that the user keeps its own file or saved the file by own self, they manage their own file. But it is hard to maintain the changes of the file. We can just accidentally replace another file that actually we need. It is easy to forget which directory you’re in and accidentally write to the wrong file or copy over files you don’t mean to. One of the most popular VCS tools was a system called RCS, which is still distributed with many computers today.
Centralized Version Control Systems
Centralized version control systems are based on the idea that there is a single “central” copy of your project somewhere (probably on a server), and programmers will “commit” their changes to this central copy. The next major issue that people encounter is that they need to collaborate with developers on other systems. A centralized version control system works on a client-server model. It allows administrators to fine-grained control over who can do what.
Distributed Version Control Systems
Distributed version control systems contain multiple repositories. Each user has their own repository and working copy. Just committing your changes will not give others access to your changes. DVCS allows automatic management branching and merging. It speeds up most operations except pushing and pulling. DVCS enhances the ability to work offline and does not rely on a single location for backups. These systems do not necessarily depend on a central server to store all the versions of a project file.
Git
Git was created by Linus Torvalds in 2005 for the development of the Linux kernel. It is a free and open-source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Its goals include speed, data integrity, and support for distributed, non-linear workflows. It is a version control system for tracking changes in computer files and coordinating work on those files among multiple people. It is primarily used for source code management in software development, but it can be used to keep track of changes in any set of files.
Git also has excellent support for branching, merging, and rewriting repository history, which has lead to many innovative and powerful workflows and tools. Pull requests are one such popular tool that allows teams to collaborate on Git branches and efficiently review each other's code.
Git Key Commands
- Git init
- Git clone
- Git add
- Git commit
- Git push
- Git stage
How Git works:
- Create a "repository" (project) with a git hosting tool (like Bitbucket)
- Copy (or clone) the repository to your local machine
- Add a file to your local repo and "commit" (save) the changes
- "Push" your changes to your master branch
- Make a change to your file with a git hosting tool and commit
- "Pull" the changes to your local machine
- Create a "branch" (version), make a change, commit the change
- Open a "pull request" (propose changes to the master branch)
- "Merge" your branch to the master branch
Conclusion
version control is a class of systems responsible for managing changes to computer programs, documents, large websites, or other collections of information. It is a component of software configuration management. It helps you store and track changes to Web source files. It is a category of software tools that helps in recording changes made to files by keeping a track of modifications done to the code.
Reference Sources
- https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control
- https://www.geeksforgeeks.org/version-control-systems
- https://www.perforce.com/blog/vcs/what-is-version-control
Comments
Post a Comment