Version control system (VCS)
What is version control system?
You can think of a Version Control System (aka VCS) as a kind of database. It lets you save snaphot of the complete project at any point in time.
- Who made the change
- Why the change was made (references to problems fixed or features added in change)
Later when it is required to take a look at on older snaphot/version, VCS shows how exactly it differed from the previous one.
Version Control System (VCS) are tools that help teams manage and track changes in code over time.
Why Version Control system is needed?
1. Collaboration
if the developers word on a same project from different regions, it will be hard for them collaborate without the version control system.
2. Storing Version
Managing multiple versions of a project in your disk can be challenging as required storing and organizing a potentially large amount of data.
3. Restoring Previous Version
Version control systems offer the ability to roll back to a previous version if needed or issue is inteoduced, developers can revert to a known working state of the project.
4. Backup
In case system or disk of the user braks down and there is no backup all the files will be lost hense version control system shoud be used
Types of version control system
- Local Version Control System
- Centralized Version Control System
- Distributed Version Control System
What is Git?
- Git is a distributed version control system widely used in software development.
- It allows multiple developers to work collaboratively on a project.
- Can effectively manage and track changes to the source code.
Git stores its data in a series of snapshots of a miniature filesystem. Every time you commit a change or save your project state, Git takes a snapshot of all your files at that moment and stores a reference to that snapshot.
A Git project resides in three sections:
The Working Directory. The single checkout of one version of the project.
The Staging Area. An index that stores information about what the next commit will contain.
The Git Repository. The place where Git stores the metadata and object database for a project.
How to push code to GitHub using Terminal
- git init - To initialize a repository, Git creates a hidden directory called .git. That directory store all of the objecs and refs that Git uses.
- git add - single file (filename) all files (.)
- git commit -m “message” - this command captures a snaphot of the project’s currently staged changes and saves the commit message.
- git branch -M main - creates a new branch “main”
- git remote add origin (url) - When you execute the command, you are specifying the URL of remote repository you want to connect to and giving it the name “origin.”
- git push -u origin main - The commend “git push -u origin main” is used in Git to push the local branch “main” to the remote repository named “origin”
How to push updated code to GitHub using Terminal
git add .git commit -m "first commit"git push
cd \file path





Top comments (0)