Skip to main content

Command Palette

Search for a command to run...

DevOps Git Project

Published
3 min read

Introduction

Managing a DevOps project requires more than just writing code—it demands a disciplined approach to version control, collaboration, and documentation. This project demonstrates Git and GitHub best practices through a hands-on workflow that mirrors real-world DevOps scenarios.

From initializing the repository to tagging a stable release, every step is documented and executed with clarity. You'll find structured branching (main, dev, feature-*), meaningful commit messages, pull request reviews, and proper tagging—all designed to simulate a professional DevOps pipeline.


📌 Objective

  • Manage a DevOps project using Git version control.

  • Practice branching, commits, pull requests, tags, and documentation.


🛠️ Tools Used

  • Git – Version control system

  • GitHub – Remote repository hosting


📝 Step-by-Step Execution

1️⃣ Repository Initialization

  1. Created project folder:

     mkdir devops-git-project && cd devops-git-project
    
  2. Initialized Git:

     git init
    
  3. Created initial files:

     echo "# DevOps Git Project" > README.md
     echo "*.log" > .gitignore
     mkdir docs
     echo "## Task Documentation" > docs/TASKS.md
    
  4. Added files to staging:

     git add .
    
  5. Committed changes:

     git commit -m "Initial commit: project setup with README, .gitignore, docs"
    
  6. Added remote GitHub repo:

     git remote add origin https://github.com/<your-username>/devops-git-project.git
    
  7. Pushed code to main branch:

     git branch -M main
     git push -u origin main
    

2️⃣ Branching

  1. Created dev branch for integration:

     git checkout -b dev
     git push -u origin dev
    
  2. Created feature branch for development:

     git checkout -b feature-setup
     git push -u origin feature-setup
    

image


3️⃣ Making Changes

  1. Edited README.md to add project details.

  2. Staged & committed changes:

     git add README.md
     git commit -m "Updated README with project overview and objectives"
     git push origin feature-setup
    

4️⃣ Pull Requests & Merging

  1. Opened Pull Request (PR) from feature-setupdev.

  2. Reviewed & merged changes into dev.

  3. Later, merged devmain for production-ready code.

    Screenshot (449)


5️⃣ Git Tags

  1. After stable release, created version tag:

     git checkout main
     git tag -a v1.0 -m "First stable release"
     git push origin v1.0
    

6️⃣ Documentation

  • README.md → Detailed project steps (this file).

  • docs/TASKS.md → Summary of tasks in Markdown format.

  • .gitignore → Prevents unnecessary files (like .log) from being committed.


📂 Repository Structure

devops-git-project/
│── docs/
│   └── TASKS.md      # Task documentation in markdown
│── .gitignore        # Git ignore rules
│── README.md         # Step-by-step execution log

✅ Deliverables

  • GitHub repo with main, dev, and feature branches.

  • Proper commit history with meaningful messages.

  • Pull Requests used for merging.

  • .gitignore file.

  • README.md with full step-by-step execution.

  • docs/TASKS.md with task documentation.

  • Git tag v1.0 for stable release.


📌 Outcome

This project successfully simulates a real-world DevOps Git workflow with:

  • Clean branching strategy

  • Proper version control practices

  • Documentation for every action taken