⚙️ Version Control and CI/CD
Git basics are the core concepts and workflows that let you track changes, collaborate, version your work, and manage infrastructure or application code reliably. Git is the backbone of automation, IaC, CI/CD, and modern cloud operations.
The concise takeaway: Git is a distributed version control system that tracks changes, manages branches, and enables collaboration through commits, pushes, pulls, and merges.
What Git Actually Is
Section titled “What Git Actually Is”Git is a distributed version control system that lets you:
- Track changes over time
- Restore previous versions
- Work on features in isolation
- Collaborate without overwriting each other
- Store infrastructure and configuration as code
- Integrate with CI/CD pipelines
Every developer or SysAdmin has a full copy of the repository — not just a remote server.
Core Git Concepts
Section titled “Core Git Concepts”1. Repository
Section titled “1. Repository”A repository (repo) is the project’s database of files and history.
It can be:
- Local (on your machine)
- Remote (GitHub, GitLab, Azure DevOps, Bitbucket)
Repos store commits, branches, tags, and the full change history.
2. Commit
Section titled “2. Commit”A commit is a snapshot of your project at a point in time.
Each commit includes:
- The changes
- A message
- Author info
- A unique hash
Commits form the timeline of your project.
3. Branch
Section titled “3. Branch”Branches let you work on features or fixes without touching main code.
Common branches:
mainormasterdev- Feature branches
- Hotfix branches
Branches make parallel development safe and organized.
4. Merge
Section titled “4. Merge”Merging brings changes from one branch into another.
Git tries to combine changes automatically; if not, you resolve conflicts manually.
5. Pull & Push
Section titled “5. Pull & Push”- Push → send your commits to the remote repo
- Pull → fetch and merge remote changes into your local repo
These are the core collaboration commands.
6. Clone
Section titled “6. Clone”Cloning copies a remote repository to your local machine.
It includes the full history and all branches.
7. Staging Area
Section titled “7. Staging Area”The staging area (index) lets you choose which changes to include in a commit.
Workflow:
- Modify files
git add→ stage changesgit commit→ save snapshot
This gives fine‑grained control over commits.
8. Tags
Section titled “8. Tags”Tags mark specific commits — often used for:
- Releases
- Versioning
- Deployment points
Example: v1.0.0.
Git Workflow (The Basics You Use Daily)
Section titled “Git Workflow (The Basics You Use Daily)”1. Initialize or Clone
Section titled “1. Initialize or Clone”Start a new repo or clone an existing one.
2. Make Changes
Section titled “2. Make Changes”Edit files in your working directory.
3. Stage Changes
Section titled “3. Stage Changes”Select which changes to commit.
4. Commit
Section titled “4. Commit”Save a snapshot with a meaningful message.
5. Push
Section titled “5. Push”Upload your commits to the remote repo.
6. Pull
Section titled “6. Pull”Bring remote changes into your local repo.
7. Branch & Merge
Section titled “7. Branch & Merge”Work safely in isolation, then merge when ready.
Why Git Matters for SysAdmins
Section titled “Why Git Matters for SysAdmins”Git enables:
- Infrastructure as Code (Terraform, Bicep, Pulumi)
- Configuration management (Ansible, DSC)
- CI/CD pipelines
- Versioned scripts and automation
- Collaboration across teams
- Rollbacks and disaster recovery
- Auditability and compliance
Git is the foundation of modern DevOps and cloud operations.
Summary
Section titled “Summary”Git basics include:
- Repositories
- Commits
- Branches
- Merges
- Push/Pull
- Staging
- Tags
Git provides version control, collaboration, and automation for code, scripts, and infrastructure.