Skip to content

⚙️ 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.


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.


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.


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.


Branches let you work on features or fixes without touching main code.
Common branches:

  • main or master
  • dev
  • Feature branches
  • Hotfix branches

Branches make parallel development safe and organized.


Merging brings changes from one branch into another.
Git tries to combine changes automatically; if not, you resolve conflicts manually.


  • Push → send your commits to the remote repo
  • Pull → fetch and merge remote changes into your local repo

These are the core collaboration commands.


Cloning copies a remote repository to your local machine.
It includes the full history and all branches.


The staging area (index) lets you choose which changes to include in a commit.
Workflow:

  1. Modify files
  2. git add → stage changes
  3. git commit → save snapshot

This gives fine‑grained control over commits.


Tags mark specific commits — often used for:

  • Releases
  • Versioning
  • Deployment points

Example: v1.0.0.


Start a new repo or clone an existing one.

Edit files in your working directory.

Select which changes to commit.

Save a snapshot with a meaningful message.

Upload your commits to the remote repo.

Bring remote changes into your local repo.

Work safely in isolation, then merge when ready.


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.


Git basics include:

  • Repositories
  • Commits
  • Branches
  • Merges
  • Push/Pull
  • Staging
  • Tags

Git provides version control, collaboration, and automation for code, scripts, and infrastructure.