Introduction
Version Control is a system that tracks changes made to files over time, allowing developers and testers to restore previous versions, compare changes, and collaborate without losing work.
Git is the world’s most popular distributed Version Control System. It is widely used in software development, automation testing, DevOps, and open-source projects to manage source code efficiently.
Purpose
The primary purpose of Version Control and Git is to:
• Track every change made to a project.
• Restore previous versions when needed.
• Enable multiple team members to work together.
• Maintain a complete project history.
What is Version Control?
A Version Control System (VCS) records every change made to project files. Instead of creating multiple copies like project_v1, project_v2, and final_final, Git stores each change as a separate version that can be viewed or restored.
Without Version Control
• Multiple file copies create confusion.
• Previous work can be lost.
• Collaboration becomes difficult.
With Git
• Every change is tracked.
• Previous versions can be restored.
• Teams can work simultaneously without overwriting each other’s work.
Types of Version Control Systems
Type Description
Local VCS Tracks versions on a single computer.
Centralized VCS Uses a central server for version management.
Distributed VCS Every user has a complete copy of the repository. Git belongs to this category.
What is Git?
Git is a free and open-source distributed Version Control System created by Linus Torvalds in 2005.
Key Features
• Distributed Version Control
• Fast performance
• Branching and merging
• Complete project history
• Offline support
Why Git is Important for Testers
QA Engineers use Git to:
• Manage Selenium automation projects.
• Track changes in test scripts.
• Work on feature branches.
• Collaborate with developers.
• Integrate automation with CI/CD pipelines.
Installing Git
Step 1: Download Git
Visit the official Git website.
Website: git-scm.com
4
Step 2: Run the Installer
• Open the downloaded installer.
• Click Next through the recommended default settings.
• Click Install.
• Click Finish after installation.
The default installation settings are suitable for beginners.
Step 3: Verify the Installation
Open Command Prompt, PowerShell, or Git Bash and run:
git –version
Expected Output
git version 2.xx.x
If a version number appears, Git has been installed successfully.
Git Bash
Git Bash is a terminal installed with Git on Windows. It allows you to run Git commands using a Linux-style command-line interface.
Example
Project
Online Shopping Automation Framework
A QA Tester installs Git before starting an automation project.
The tester:
• Downloads Git.
• Installs it using the default settings.
• Verifies the installation with git –version.
Expected Result
Git is successfully installed, allowing the tester to begin managing the automation framework with version control.
Best Practices
• Download Git only from the official website.
• Verify the installation using git –version.
• Keep Git updated to the latest stable version.
• Use Git Bash or PowerShell for Git commands.
Interview Tip
Question
Why is Git called a Distributed Version Control System?
Answer
Git is called a Distributed Version Control System because every developer has a complete copy of the repository, including its full history, allowing work even without an internet connection.
Key Takeaways
• Version Control tracks changes made to project files.
• Git is a distributed Version Control System.
• Git allows safe collaboration across teams.
• Git Bash provides a command-line interface for Git commands.
• Always verify the installation using git –version.
