0% found this document useful (0 votes)
21 views19 pages

Unit Ii

Version control systems (VCS) are essential tools for tracking changes in files, facilitating collaboration among developers, and managing code modifications. They enhance project development speed, reduce errors, and allow contributions from various locations. Different types of VCS include local, centralized, and distributed systems, with Git being a prominent example that supports efficient source code management and collaboration.

Uploaded by

divyajegan112
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views19 pages

Unit Ii

Version control systems (VCS) are essential tools for tracking changes in files, facilitating collaboration among developers, and managing code modifications. They enhance project development speed, reduce errors, and allow contributions from various locations. Different types of VCS include local, centralized, and distributed systems, with Git being a prominent example that supports efficient source code management and collaboration.

Uploaded by

divyajegan112
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

UNIT II

Version Control Systems

Prepared by
[Link] Mary
AP CSE
Why Version Control system is so
Important?
• Version control systems are a category of software tools
that helps in recording changes made to files by keeping
a track of modifications done in the code.
• software product is developed in collaboration by a group
of developers
• A version control system is a kind of software that helps
the developer team to efficiently communicate and
manage(track) all the changes that have been made to
the source code along with the information like who made
and what changes have been made
Benefits of the version control system
• Enhances the project development speed by providing efficient
collaboration,
• Leverages the productivity, expedites product delivery, and skills of
the employees through better communication and assistance,
• Reduce possibilities of errors and conflicts meanwhile project
development through traceability to every small change,
• Employees or contributors of the project can contribute from
anywhere irrespective of the different geographical locations
through this VCS,
• For each different contributor to the project, a different working copy
is maintained and not merged to the main file unless the working
copy is validated. The most popular example is Git, Helix core,
Microsoft TFS,
• Helps in recovery in case of any disaster or contingent situation,
Use of Version Control System

• A repository
• Copy of Work (sometimes called as checkout)
• Working in a group
Types of Version Control Systems:
• Local Version Control Systems
• Centralized Version Control Systems
• Distributed Version Control Systems
Local Version Control Systems
• It is one of the simplest forms and has a database that
kept all the changes to files under revision control.
• RCS is one of the most common VCS tools.
• It keeps patch sets (differences between files) in a special
format on disk.
• By adding up all the patches it can then re-create what
any file looked like at any point in time
Centralized Version Control Systems
• Centralized version control systems contain just one
repository globally and every user need to commit for
reflecting one’s changes in the repository.
• It is possible for others to see your changes by updating.
• Two things are required to make your changes visible to others which
are:
– They update
– You commit
The benefit of CVCS (Centralized Version
Control Systems)
• It makes collaboration amongst developers
• It allows administrators to control over who can do what
• dis advantages :
– The most obvious is the single point of failure that the
centralized repository represents if it goes down during that
period collaboration and saving versioned changes is not
possible.
– What if the hard disk of the central database becomes
corrupted, and proper backups haven’t been kept? You lose
absolutely everything.
Distributed Version Control Systems:
• It contain multiple repositories
• Each user has their own repository and working copy
• Just committing your changes will not give others access to your
changes
• This is because commit will reflect those changes in your local
repository and you need to push them in order to make them
visible on the central repository
• make your changes visible to others, 4 things are required:
– You commit
– You push
– They pull
Purpose of Version Control:
• Multiple people can work simultaneously on a single project.
Everyone works on and edits their own copy of the files and it is
up to them when they wish to share the changes made by them
with the rest of the team.
• It integrates the work that is done simultaneously by different
members of the team. In some rare cases, when conflicting edits
are made by two people to the same line of a file, then human
assistance is requested by the version control system in
deciding what should be done.
• Version control provides access to the historical versions of a
project. This is insurance against computer crashes or data loss.
If any mistake is made, you can easily roll back to a previous
version.
• It is also possible to undo specific edits that too without losing
What is Git Repository and How to Create One
• A Git repository is a central storage location for managing
and tracking changes in files and directories.
• It is a crucial component of the Git version control system
• Git repositories are widely used in software development
for efficiency
• A Git repository stores all the versions of files within a
project, enabling developers to track changes,
collaborate, and easily revert to previous versions if
needed.
• Each file's changes are recorded as commits, which are
organized into branches, providing a structured history of
the project's development
Types of Git Repositories
• Bare Repositories:
• A bare repository is a server-side repository that does not have a
working directory.
• It only contains the versioned data and the Git history.
• Bare repositories are primarily used as a central hub for collaboration,
where developers can push and pull changes from multiple local
repositories.
• They do not allow direct editing of files or performing builds.
• Bare repositories are often used in a team setting, where a shared
repository is needed for collaboration.
• They provide a reliable and secure way to manage code changes and
ensure that all team members have access to the latest version of the
• Non-Bare Repositories:

• Non-bare repositories, also known as working repositories, include both


the versioned data and a working directory.
• Developers work directly with the files in the working directory, modifying
and testing code.
• Non-bare repositories are typically cloned from a bare repository or
another non-bare repository.

• Non-bare repositories are used by individual developers or smaller teams


who want to work on their local copies of the code.
• They allow developers to make changes, test them, and later push those
changes to a shared bare repository for collaboration.
• Non-bare repositories are created by using the git init command without
difference between bare and non bare
Feature Non-Bare Repository Bare Repository

Working Directory Yes, you can modify files directly. No, only Git data (no working directory).

.git Directory Inside the root directory as .git The entire repository is .git (bare).

Use Case Local development, interacting with files. Centralized, shared repository (e.g., remote).

Pushing/Pulling You push to/pull from other repositories. It acts as the target repository for pushing and pulling.

Typical Command git clone, git init (default is non-bare) git init --bare

When to Use Bare vs Non-Bare Repositories


•Non-Bare: Use this for your local development environment where you are working directly on the files.
•Bare: Use this for a central shared repository (often on a server) where other users can push/pull changes.
What is Git: Features, Commands, Branch and Workflow in Git
● git is a DevOps tool used for source code management.
● It is a free and open-source version control system used to handle small to
very large projects efficiently.
● Git is used to tracking changes in the source code, enabling multiple
developers to work together on non-linear development
● Before diving deep, let’s explain a scenario before Git:
a. Developers used to submit their codes to the central server without
having copies of their own
b. Any changes made to the source code were unknown to the other
developers
c. There was no communication between any of the developers
What is Git?

git is a version control system used for tracking changes in computer files. It is
generally used for source code management in software development.
● Git is used to tracking changes in the source code
● The distributed version control tool is used for source code management
● It allows multiple developers to work together
● It supports non-linear development through its thousands o f parallel branches
Features of Git

You might also like