Module 4: Version Control Systems and Continuous Integration (CI)
1. Introduction to Version Control Systems (VCS)
Q1. What is a Version Control System and why is it important in DevOps?
A Version Control System (VCS) is software that helps track and manage changes to source
code over time. It allows multiple developers to collaborate, review, and restore previous
versions if needed. In DevOps, VCS ensures code integrity, enables teamwork, and forms the
foundation for continuous integration (CI) and automated builds.
Q2. Differentiate between Centralized and Distributed Version Control Systems.
Centralized VCS: Single central server, online required, examples - SVN, CVS.
Distributed VCS: Each user has full local copy, works offline, examples - Git, Mercurial.
Distributed systems like Git provide better fault tolerance and performance.
Q3. What are the advantages of using Version Control Systems in software
development?
Maintains history, enables collaboration, supports branching and merging, provides
rollback, and integrates with CI/CD tools.
2. Git Basics
Q1. What is Git and what makes it popular among developers?
Git is a distributed version control system that tracks changes in source code. It supports
offline work, is fast, handles branching efficiently, and integrates with CI/CD and cloud
repositories like GitHub.
Q2. Explain the Git architecture and workflow components.
Git has three areas: Working Directory, Staging Area, and Local Repository.
Workflow: git add → git commit → git push.
Q3. List and explain basic Git commands used in everyday development.
git init – create repo, git clone – copy repo, git add – stage changes, git commit – save, git
push/pull – sync changes.
3. Branching and Merging
Q1. What is branching in Git and why is it important?
Branching allows independent development without affecting main code. Example: git
branch featureX, git checkout featureX.
Q2. Explain the merging process in Git with types of merges.
Merging integrates changes from one branch to another.
Types: Fast-forward, Three-way merge, Rebase.
Q3. How does branching and merging support collaborative development?
Teams work independently, merge safely, and resolve conflicts easily. This aligns with Agile
and CI/CD practices.
4. Git Workflow
Q1. Describe the standard Git workflow from local development to deployment.
Clone → Edit → Stage → Commit → Push → Pull/Merge ensures synchronization between
local and remote repositories.
Q2. What is a Pull Request (PR) and its role in the Git workflow?
A Pull Request is a request to merge code from one branch into another after review and
approval.
Q3. Explain the difference between Gitflow and Trunk-Based workflows.
Gitflow: multiple long-lived branches (develop, release).
Trunk-based: short-lived branches, frequent commits to main.
5. Git Best Practices
Q1. List and explain some Git best practices for DevOps teams.
Commit frequently, use branching models, review via pull requests, keep commits small,
sync often.
Q2. How do good commit messages improve project maintainability?
Good messages clarify change purpose. Example: git commit -m 'Fix: handled null pointer
exception in login'.
Q3. Why is it recommended to use .gitignore and avoid committing sensitive data?
.gitignore skips files like credentials and temp files, preventing leaks and keeping repo
clean.