πŸš€ DevOps Day 9 — Git & GitHub Fundamentals (Version Control Explained)

Welcome to Day 9 of the DevOps journey.

Today’s focus is on one of the most important tools in software development — Git and GitHub.

Before learning CI/CD, Docker, or cloud automation, every DevOps engineer must clearly understand Version Control Systems (VCS) — because DevOps starts with code collaboration and change management.


πŸ” What Is a Version Control System (VCS)?

A Version Control System helps developers:

  • Track changes in code

  • Collaborate with multiple developers

  • Restore older versions when something breaks

In real-world projects, applications contain hundreds or thousands of files, and multiple developers work on them at the same time. Managing this manually becomes nearly impossible.

That’s where VCS comes in.


❗ Problems Without Version Control

1️⃣ Code Sharing Problem

In early days, developers shared code using:

  • Email

  • USB drives

  • File servers

This caused:

  • Missing files

  • Dependency issues

  • Conflicts between developers

Managing a large application like this was extremely inefficient.


2️⃣ Versioning Problem

Imagine this situation:

  • Code worked yesterday

  • Today’s changes broke the application

  • No backup available

Without version control:

  • You cannot roll back

  • You cannot identify who changed what

  • You lose stability

Versioning solves this by maintaining complete history of changes.


⭐ Why Git Became So Popular

Before Git, tools like CVS and SVN were used.

⚠️ Centralized Version Control (Old Systems)

  • Single central server

  • Developers depend on that server

  • If server goes down → work stops

This created a single point of failure.


✅ Git: Distributed Version Control System

Git is a distributed VCS, meaning:

  • Every developer has a full copy of the repository

  • Each copy contains complete history

  • Work can continue even if one system fails

This design makes Git:

  • Faster

  • More reliable

  • Highly scalable


🍴 What Is Forking?

A fork is a complete copy of a repository.

It allows developers to:

  • Experiment freely

  • Make independent changes

  • Contribute back through pull requests

Forking is one of the reasons open-source projects scale so efficiently.


πŸ” Git vs GitHub — Common Confusion

🧩 Git

  • Open-source tool

  • Installed locally

  • Handles version control

  • Works offline

You can use Git even without the internet.


🌐 GitHub

  • Cloud-based platform built on Git

  • Helps in sharing code

  • Provides collaboration features like:

    • Pull requests

    • Issues

    • Code reviews

    • Project management

Other similar platforms:

  • GitLab

  • Bitbucket

πŸ‘‰ Git is the engine. GitHub is the collaboration platform.


πŸ§ͺ Basic Git Workflow

1️⃣ Install Git

Download from:

https://git-scm.com

Verify installation:

git --version

2️⃣ Initialize a Repository

git init

This converts your folder into a Git repository.


3️⃣ Check Repository Status

git status

Shows:

  • Modified files

  • Staged files

  • Untracked files


4️⃣ Stage Files

git add .

Moves files to the staging area.


5️⃣ Commit Changes

git commit -m "Initial commit"

Creates a snapshot (version) of your code.


6️⃣ View Changes

git diff

Shows differences between current code and last commit.


7️⃣ View Commit History

git log

8️⃣ Revert to Previous Version

git reset --hard <commit-id>

Restores code to an earlier working state.

⚠️ Use carefully — it removes changes permanently.


🌍 Sharing Code Using GitHub

Git handles local version control, but to collaborate with others, we use GitHub.

Steps:

  1. Create a repository on GitHub

  2. Choose public or private access

  3. Push your local Git repository to GitHub

  4. Share code with teams and organizations

This creates a distributed development workflow, which is essential in DevOps.


🧠 Why Git Is Critical for DevOps Engineers

Git is used in:

  • CI/CD pipelines

  • Infrastructure as Code

  • Terraform modules

  • Kubernetes manifests

  • Automation scripts

Every DevOps tool integrates with Git.

πŸ‘‰ No Git = No DevOps


✅ Summary



On Day 9, we learned:

  • What Version Control Systems are

  • Problems solved by VCS

  • Why Git replaced older tools

  • Difference between Git and GitHub

  • Essential Git commands

  • How code sharing works in real-world projects

Git forms the foundation of DevOps culture — collaboration, tracking, and continuous improvement.

Comments

Popular posts from this blog

🧩 DevOps Day 1 — Fundamentals of DevOps

DevOps Day 23 — Multi-Stage Docker Builds & Distroless Images: Build Smaller, Safer Containers

πŸš€ DevOps Day 2 — Understanding the SDLC and the Role of DevOps Engineers