Skip to content

About

DevOps Git Hands-On Lab: Mastering Git version control, branching strategies, conflict resolution & Conventional Commits

Topics

Resources

Code of conduct

Contributing

Security policy

Accessibility

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

DevOps Git & Collaboration Mastery Hands-On Lab

GitHub Release License: MIT GitHub Stars GitHub Forks Git GitHub Flow YouTube: @codewithmuh

A hands-on, practical lab environment for mastering Git version control, branching strategies, conflict resolution, Pull Request workflows, and Conventional Commits for DevOps engineers.

Overview • Branching Architecture • Hands-On Exercises • Conventional Commits • Cheatsheet


Overview

Version control is the backbone of all modern DevOps and Continuous Integration/Continuous Deployment (CI/CD) practices. This repository serves as a sandbox environment where engineers can practice feature branching, remote collaboration, merge conflict resolution, and trunk-based continuous delivery without risking production code.


Git Workflow & Branching Architecture

gitGraph
    commit id: "Initial Commit"
    commit id: "Base Scaffold"
    branch feature/user-auth
    checkout feature/user-auth
    commit id: "feat: add JWT auth middleware"
    commit id: "test: verify token validation"
    checkout main
    commit id: "docs: update API documentation"
    checkout feature/user-auth
    commit id: "fix: handle expired tokens"
    checkout main
    merge feature/user-auth tag: "PR #1 Merged"
    branch bugfix/db-timeout
    checkout bugfix/db-timeout
    commit id: "fix: adjust connection pool timeout"
    checkout main
    merge bugfix/db-timeout tag: "v1.0.0 Release"
Loading

Hands-On Practice Exercises

Lab 1: Branch Isolation & Pull Request Flow

  1. Clone the repository:

    git clone https://github.com/codewithmuh/devops-training.git
    cd devops-training
  2. Create a dedicated feature branch:

    git switch -c feature/add-healthcheck
  3. Implement your changes and stage:

    echo "GET /healthz 200 OK" >> healthcheck.txt
    git add healthcheck.txt
  4. Commit using Conventional Commits:

    git commit -m "feat(api): implement standard healthcheck endpoint"
  5. Push upstream and open a Pull Request:

    git push -u origin feature/add-healthcheck

Lab 2: Simulating & Resolving Merge Conflicts

  1. Modify a common line on your branch:

    echo "DevOps Training Lab Update - Branch A" > Notes.txt
    git commit -am "chore: update notes from branch A"
  2. Simulate a conflicting commit on main:

    git checkout main
    echo "DevOps Training Lab Update - Branch Main" > Notes.txt
    git commit -am "chore: update notes from main"
  3. Attempt to merge:

    git merge feature/add-healthcheck
    # CONFLICT (content): Merge conflict in Notes.txt
  4. Resolve the conflict: Open Notes.txt, choose the correct lines between <<<<<<< HEAD, =======, and >>>>>>>, save the file, and finalize:

    git add Notes.txt
    git commit -m "fix(merge): resolve conflicting notes updates"

Conventional Commits Specification

Standardized commit messages ensure automated changelogs and clean repository history:

Prefix Description Example
feat: Introduces a new feature or capability feat(auth): add OAuth2 Google login provider
fix: Patches a bug or defect fix(cors): permit localhost origins in development
docs: Updates documentation or README files docs(readme): add architecture flowchart and setup guide
chore: Maintenance tasks, dependency updates chore(deps): bump actions/checkout to v4
ci: CI/CD pipeline modifications ci(github): add automated trivy security scan job
refactor: Code refactoring without changing functionality refactor(db): migrate connection logic to singleton

Git Quick Reference

Inspect commands.txt for an exhaustive list of essential daily Git commands covering branching, stashing, log visualization, and reset mechanics.


Resources & Community


License

This project is licensed under the MIT License.

About

DevOps Git Hands-On Lab: Mastering Git version control, branching strategies, conflict resolution & Conventional Commits

Topics

Resources

Code of conduct

Contributing

Security policy

Accessibility

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors