Skip to content

santoshbaba1/git_assignment_HeroVired

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git_assignment_HeroVired

CalculatorPlus – Git Assignment (Hero Vired)

This repository contains all tasks completed as part of the Hero Vired Git & GitHub Assignment, including branching workflows, feature development, Git LFS usage, stash operations, pull requests, code reviews, and releases.


📂 Repository Structure

git_assignment_HeroVired/
│
├── calculator.py                # CalculatorPlus application (Q1)
├── geometry.py                  # Geometry Calculator (Q3)
├── bigdata.zip (LFS example)    # Large file tracked using Git LFS (Q2)
├── .gitattributes               # Git LFS tracking rules
└── README.md                    # Assignment documentation

Q1 – CalculatorPlus Application

1️⃣ Repository Setup

  • Created repository named git_assignment_HeroVired
  • Set repository visibility to Private
  • Cloned the repo locally

Commands:

git clone https://github.com/santoshbaba1/git_assignment_HeroVired.git
cd git_assignment_HeroVired

2️⃣ Created dev Branch

git checkout -b dev

3️⃣ Added CalculatorPlus Code

Implemented:

  • Addition
  • Subtraction
  • Multiplication
  • Division
  • Square Root (new feature)

File created: calculator.py


4️⃣ Merged dev → main (Version 1 Release)

git checkout main
git merge dev
git push

Release created: v1.0


5️⃣ Added Collaborator

A classmate was added as a collaborator for reviewing the code.


6️⃣ Feature Branch: feature/sqrt

git checkout -b feature/sqrt

Improved and tested the square root feature.


7️⃣ Critical Bug Fix in divide()

Updated implementation:

def divide(self, a, b):
    if b == 0:
        raise ValueError("Cannot divide by zero.")
    return a / b

8️⃣ Updated Feature Branch

git checkout feature/sqrt
git pull origin dev

9️⃣ Pull Request & Code Review

  • PR created from feature/sqrtmain
  • Reviewer suggestions implemented
  • PR merged into dev

🔟 Final Testing & Release v2.0

git checkout main
git merge dev
git push

Release created: v2.0


Q2 – Git LFS Integration

1️⃣ Install Git LFS

git lfs install

2️⃣ Created Branch lfs

git checkout -b lfs

3️⃣ Tracked Large File (>200MB)

git lfs track "*.zip"

4️⃣ Added & Pushed Large File

git add bigdata.zip .gitattributes
git commit -m "Added large zip file with Git LFS"
git push -u origin lfs

5️⃣ Verified on Another Machine

Cloned repository to verify automatic LFS download.


Q3 – Geometry Calculator (Git Stash Workflow)

File: geometry.py

  • Circle area: π * r²
  • Rectangle area: l * w

1️⃣ Created Branch

git checkout -b geometry-calculator

2️⃣ Circle Area Feature

git checkout -b feature/circle-area
git stash

3️⃣ Rectangle Area Feature

git checkout -b feature/rectangle-area
git stash

4️⃣ Completed Circle Area Feature

git checkout feature/circle-area
git stash pop
git add .
git commit -m "Completed circle area feature"
git push

5️⃣ Completed Rectangle Area Feature

git checkout feature/rectangle-area
git stash pop
git add .
git commit -m "Completed rectangle area feature"
git push

6️⃣ Pull Requests

PRs created for both features targeting dev.


7️⃣ Code Review & Merge

  • PRs reviewed and approved
  • Both merged into main

Code Review Completed

A complete code review was given to a classmate, covering:

  • Error handling
  • Code improvements
  • Testing suggestions
  • README improvements

Assignment Completed

All tasks for:

  • Q1 (CalculatorPlus)
  • Q2 (Git LFS)
  • Q3 (Geometry Calculator + Stash)

Have been successfully implemented.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages