What is version controller?
A version controller, also known as Version Control System (VCS), is a tool that helps manage changes to files, code, and documents over time.
It allows multiple people to collaborate on a project, track revisions, and revert to previous versions if needed.
Types of VCS:
There are three main types of Version Control Systems (VCS)
1. Local Version Control System (LVCS)
Tracks changes on a single computer.
Typically uses simple file backups or a local database.
2. Centralized Version Control System (CVCS)
Uses a single central server to store all versions of files.
Developers pull and push changes from/to the server.
3. Distributed Version Control System (DVCS)
Each user has a full copy of the entire repository, including history.
Changes can be committed locally and later pushed to a remote repository.
Introduction to Git:
Git is a distributed version control system used for tracking changes in source code during software development.
It allows multiple developers to work on the same project efficiently while keeping track of modifications.
History of Git:
Pre-Git Era: Using BitKeeper
Before 2005, the Linux community used BitKeeper, a commercial version control system.
In 2005, a dispute led to BitKeeper revoking free access, pushing the need for an alternative.
Creation of Git (2005)
Linus Torvalds developed Git in April 2005 within a few weeks.
Developers rapidly adopted Git in open-source projects.
By 2008, major platforms like GitHub emerged, making Git the go-to system.
Why Use Git?
Version Control: Keeps track of every change made to files.
Collaboration: Multiple developers can work on a project simultaneously.
Branching & Merging: Work on new features without affecting the main codebase.
Backup & Recovery:Prevents data loss with repositories stored locally and remotely.
what is GitLab?
GitLab is a web-based DevOps platform that provides Git repository management, CI/CD (Continuous Integration & Deployment), issue tracking, and security in one integrated solution.
It is an alternative to GitHub and Bitbucket, designed for teams that want full control over their code and development workflow.
Basic Terminology of version:
Working Directory (Local Files)
The working directory is where you create, edit, and manage project files on your local machine.
These files are not yet tracked by Git until you add them to the staging area.
Staging Area (Index)
The staging area is where you add selected changes before committing them.
It acts as a preparation step, allowing you to decide which files should be included in the next commit.
Local Repository
Once the changes are staged, they need to be committed to the local repository.
A commit is like a checkpoint, allowing you to track changes over time.
Remote Repository (GitLab)
After committing changes locally, you need to push them to a remote repository on GitLab.
This allows collaboration with other developers.
Git vs GitLab:
Installation of git in linux:
Run the command in terminal
sudo apt install git
To verify whether installed and check the version of git:
git --version