Starting from:

$25

CSCI3901-Lab 5 Version Control Solved

In this lab, you will explore the version control system called Git.

, you will apply your knowledge of version control, notably Git, to manage a set of files for a project.

You will be given an initial configuration of Git for a project and will be asked to effect a set of changes to the files, stored in Git, to achieve a target configuration for your Git repository.

Preparation
• Download and install Git. You may use your IDE if it supports git integration, or through the command line (on windows, you may want to install Git Bash alongside Git for this).


Procedure
Set-up

1. Download and unzip the Git repository from Brightspace.

Lab steps

Part 1 - History Using git status, git log, git diff, and git branch answer the following questions:

1.   How many commits are there?

2.   What is the commit message associated with the most recent commit?

3.   Which commit added the basePrices static variable?

4.   How many branches are there?

5.   Which is the last commit on the coupons branch?

Resources: status, diff, log, branch

Part 2 - Basic operations

1.   Fix the 3 remaining bugs from the Debugging lab. In particular:

•    On lines 62, 64, and 66, topping == str should be topping.equals(str)

•    On lines 63, 65, and 67, price = should be price +=

•    The final price should be price = price - price*coupon/100

2.   Commit these bug fixes with a suitable commit message

Resources: add, commit

Part 3 - Branching

1.   Create a new branch called burger. Your new branch should be off the repository’s master branch

2.   Add a new menu option for a burger. A burger at HfxDonairExpress costs $2.50

3.   Commit this change on the burger branch

4.   Finally, merge the burger branch into the main branch

Resources: branch, checkout, add, commit, merge

Questions
1.   When working alone on a project, how frequently should you commit your code to a version control system? Explain why.

2.   When working in a team, how frequently should you commit your code to a version control system? Explain why.

3.   Why might you create branches for your project in your version control system?

Reporting
1.   In one file, list

•    The members of your team.

•    The answers to the questions in part 1.

•    The final output of git log after parts 2 and 3 have been completed.

•    The answers to the Questions section of the lab

2.   Generate a PDF from the document.

3.   Create a .zip file of the git repository.

More products