Git Assignment – HeroVired: git_assignment_HeroVired
📌 Overview This repository demonstrates the implementation of Git workflows including: • Branching strategy (main, dev, feature branches) • Pull request workflow • Bug fixing and feature development • Git LFS for large files • Git stash usage for parallel development
🧮 Q1 — CalculatorPlus (Square Root Feature) 🔹 Step 1: Initial Setup • Created repository: git_assignment_HeroVired • Created dev branch from main • Added base calculator code: def divide(self, a, b): return a / b
🔹 Step 2: Release v1.0 • Merged dev → main • Created Release v1.0
🔹 Step 3: Feature Development (feature/sqrt) • Created branch: feature/sqrt from dev • Implemented square root: def square_root(self, x): return math.sqrt(x)
🔹 Step 4: Bug Fix (Critical Issue) • Switched to dev • Fixed divide function: def divide(self, a, b): if b == 0: raise ValueError("Cannot divide by zero.") return a / b • Merged dev into feature/sqrt to keep branch updated
🔹 Step 5: Pull Request & Review • Created PR: feature/sqrt → dev • Added collaborator • Code reviewed and approved
🔹 Step 6: Final Merge & Release • Merged feature/sqrt → dev • Tested application • Merged dev → main • Created Release v2.0
📦 Q2 — Git LFS (Large File Handling) 🔹 Steps Performed • Installed Git LFS (git lfs install) • Created branch: lfs • Tracked large files: git lfs track "*.mp4" • Added file: new_york_city_international_love.mp4 (~211 MB) • Committed .gitattributes • Pushed file using Git LFS
🔹 Verification • Verified using: git lfs ls-files • Cloned repository on another system • Confirmed large file downloaded correctly
📐 Q3 — Geometry Calculator (Git Stash Workflow) 🔹 Base Setup • Created branch: geometry-calculator • Added base file with circle & rectangle logic
🔹 Feature 1: Circle Area • Created branch: feature/circle-area • Added partial implementation • Used: git stash
🔹 Feature 2: Rectangle Area • Created branch: feature/rectangle-area • Added partial implementation • Used: git stash
🔹 Resume Work Using Stash • Switched back to feature/circle-area • Applied stash: git stash pop • Completed feature → committed & pushed
• Switched to feature/rectangle-area
• Applied stash → completed → committed & pushed
🔹 Pull Requests • Created PRs to dev • Got review and approval • Merged into main
✅ Additional Requirements Completed ✔ Added collaborator for code review ✔ Followed proper Git workflow ✔ Used branching strategy effectively ✔ Maintained clean commit history
📎 Submission • Repository link shared via submission file (as required) https://github.com/TabrezAjaz/git_assignment_HeroVired