git_assignment_HeroVired - Assignment Repository created by Sunil Gaddi
QUESTION : 01 ====================================================================================================================================
Steps Followed:
- Create a repository: git init git_assignment_HeroVired cd git_assignment_HeroVired git remote add origin <repository_url>
- Create 'dev' branch and add the code:
- Merge 'dev' branch with 'main' and release version 1: git checkout -b dev git add . git commit -m "Add basic calculator functionality" git push origin dev git tag -a v1.0 -m "Release version 1.0" git push origin v1.0
- Add collaborators:
- Create 'feature/sqrt' branch and add the 'sqrt' code: git checkout -b feature/sqrt git add . git commit -m "Add square root feature" git push origin feature/sqrt
- Bug fix in 'dev' branch: git checkout dev git add . git commit -m "Fix divide function" git push origin dev
- Create a pull request for the 'feature/sqrt' branch: On GitHub, create a pull request targeting the 'dev' branch.
- Code review and improvements: Your team member reviews the pull request, suggests changes. Make changes locally and push again. Repeat until the code is approved.
- Merge 'feature/sqrt' into 'dev': git checkout dev git merge feature/sqrt git push origin dev
- Testing and merge into 'main', create version 2 release: git checkout main git merge dev git push origin main git tag -a v2.0 -m "Release version 2.0" git push origin v2.0
QUESTION : 02 ====================================================================================================================================
Steps Followed:
-
Set up Git LFS: First, ensure that Git LFS is installed on your system. You can download and install it from the official Git LFS website if you haven't already.
-
Initialize a Git repository and create a branch, If you haven't already, initialize a Git repository and create a new branch 'lfs' in your repository
git init
git checkout -b lfs
-
Configure Git LFS for your repository: Configure Git LFS to track files with specific extensions or files larger than a certain size. In this case, we will track files larger than 200MB
git lfs track ".bin" # Track binary files with the .bin extension git lfs track ".zip" # Track binary files with the .zip extension
-
Add and commit a large binary file: Add your large binary file(s) to the repository and commit them.
git add your_large_file.bin
git commit -m "Add large binary file"
-
Push to the 'lfs' branch: Push your changes to the 'lfs' branch. Git LFS will automatically handle the large binary files. git push origin lfs
-
Clone the repository on another machine: To verify that the binary files are downloaded correctly on another machine, clone the 'lfs' branch from the 'git_assignment_HeroVired' repository.
git clone https://github.com/yourusername/git_assignment_HeroVired.git cd git_assignment_HeroVired
git checkout lfs
-
After cloning and checking out the 'lfs' branch, the binary files should be automatically downloaded from Git LFS. You can verify this by checking the file sizes and contents on the new machine.
-
This process will allow you to efficiently manage large binary files in your Git repository using Git LFS. Just make sure that the '.gitattributes' file contains the correct tracking patterns for your specific binary file types.
QUESTION : 03 ====================================================================================================================================
Steps Followed:
- Clone the GitHub repository to your local machine if you haven't already: git clone <repository_url> cd <repository_directory>
- Create a new branch "feature/circle-area" to work on the circle area feature: git checkout -b feature/circle-area
- Implement the circle area feature by editing the code in your Python file. Don't forget to uncomment the relevant code.
- Before committing the changes, stash them to save the incomplete feature implementation: git stash
- Verify that the working directory is clean: git status
- Create a new branch "feature/rectangle-area" to work on the rectangle area feature: git checkout -b feature/rectangle-area
- Implement the rectangle area feature by editing the code in your Python file. Don't forget to uncomment the relevant code.
- Before committing the changes, stash them to save the incomplete feature implementation: git stash
- Verify that the working directory is clean: git status
- Switch back to the "feature/circle-area" branch to continue working on the circle area feature: git checkout feature/circle-area
- Retrieve the stashed changes for the circle area feature: git stash pop
- Complete the circle area feature implementation and save the changes, Commit the changes: git add . git commit -m "Implement circle area feature"
- Push the changes to the repository: git push origin feature/circle-area
- Switch back to the "feature/rectangle-area" branch to continue working on the rectangle area feature: git checkout feature/rectangle-area
- Retrieve the stashed changes for the rectangle area feature: git stash pop
- Complete the rectangle area feature implementation and save the changes.Commit the changes: git add . git commit -m "Implement rectangle area feature"
- Push the changes to the repository: git push origin feature/rectangle-area
- Create two pull requests, one for "feature/circle-area" and one for "feature/rectangle-area," targeting the "dev" branch.
- reviewer review your pull requests.
- After receiving approval, merge both pull requests into the "dev" or "main" branch as per your project's branching strategy.