Skip to content

luckyborana/git_assignment_HeroVired

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 

Repository files navigation

git_assignment_HeroVired/main(Branch) │ ├── calculator.py ├── geometry_calculator.py └── README.md

git_assignment_HeroVired/lfs(Branch) │ ├── calculator.py ├── large_file.bin (via Git LFS) ├── README.md └── .gitattributes

✅ Q1 – CalculatorPlus Application

🔧 Task Summary

You are part of a development team building a Python app CalculatorPlus, which performs:

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

📝 Steps Completed

1. Repository Created

  • Repository name: git_assignment_HeroVired
  • Set repository visibility: Private

2. Branch Structure

  • Created branch: dev
  • Added calculator code to the dev branch

3. Implemented Square Root Feature

def square_root(self, x):
    return math.sqrt(x)
  • Tested the feature in the main block.

4. Merged to Main & Released v1

  • Merged devmain
  • Created Release v1.0

5. Added Collaborator

  • Added one classmate as a collaborator for code review.

6. Created Feature Branch

Created new branch:

feature/sqrt

Added the square root implementation.

7. Critical Bug Fix

A bug was reported in the divide() function. Fix applied:

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

Updated feature branch:

git pull origin dev

8. Pull Request Process

  • Created PR from feature/sqrtdev
  • Requested review from collaborator
  • Made changes based on feedback
  • Merged after approval

9. Final Testing & Release

  • Performed testing in dev
  • Merged devmain
  • Created Release v2.0

✅ Q2 – Git LFS Integration

Steps Completed

1. Created LFS Branch

git checkout -b lfs

2. Installed Git LFS

git lfs install

3. Tracked Large Files

git lfs track "*.bin"
git lfs track "*.pdf"
git add .gitattributes
git commit -m "Configured Git LFS"

4. Added Large File (>200MB)

git add large_file.bin
git commit -m "Added 200MB file using Git LFS"
git push origin lfs

5. Clone & Verification

On another system:

git clone <repo-url>
git lfs pull

Large files downloaded correctly.


✅ Q3 – Geometry Calculator with Git Stash

This section demonstrates using Git stash to switch between incomplete features.

🧮 Features

  • Calculate area of circle
  • Calculate area of rectangle

📝 Workflow Steps

1. Created Main Working Branch

git checkout -b geometry-calculator

Added file changes and committed

2. Circle Feature Start

git checkout -b feature/circle-area

Started writing circle-area code changes.

git stash

3. Rectangle Feature Start

git checkout -b feature/rectangle-area

Started rectangle-area code changes.

git stash

4. Returned to Circle Area

git checkout feature/circle-areaa
git stash pop

Completed feature → committed → pushed.

5. Completed Rectangle Area

git checkout feature/rectangle-area
git stash pop

Completed feature → committed → pushed.

6. Merging in Dev both PR

feature/rectangle-area >> dev feature/circle-areaa >> dev

dev >> main

About

Calculator_Plus Application

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages