π DevOps Day 9 — Git & GitHub Fundamentals (Version Control Explained)
Welcome to Day 9 of the DevOps journey.
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:
Verify installation:
2️⃣ Initialize a Repository
This converts your folder into a Git repository.
3️⃣ Check Repository Status
Shows:
-
Modified files
-
Staged files
-
Untracked files
4️⃣ Stage Files
Moves files to the staging area.
5️⃣ Commit Changes
Creates a snapshot (version) of your code.
6️⃣ View Changes
Shows differences between current code and last commit.
7️⃣ View Commit History
8️⃣ Revert to Previous Version
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:
-
Create a repository on GitHub
-
Choose public or private access
-
Push your local Git repository to GitHub
-
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
Post a Comment