CSCI 265 Quiz 2 Sample Solutions Fall 2025


Question 1: your team 265 github repo and process

First, provide a clear outline of the process your team uses to coordinate modifications to files in your team github.
Second, use the following scenario to support/clarify your process description: (There is more space on the back of this page if needed.)

Sample solution

Half the marks here were for the process description, half for the A/B/F scenario.

Mostly the marks were pretty good, the only common issues were either
  - not giving sufficient detail to make it clear the exact order of operations
and/or
  - not having (or describing) sufficient constraints to ensure there weren't
    easily avoidable clashes

Question 2: individual scenario regarding the CSCI git submit cycle

For the following scenario we're assuming you must follow our department's typical CSCI git cycle of fork, clone, edits/adds/commits/pushes, along with branching and merging and the need to add the instructor's repo as a remote and periodically do pulls from it.

For each step in the scenario below, include the exact git command you would use to carry out that step (the initial ssh fork command is provided as part of the scenario setup).
You don't need to provide the file editing commands nor the various cd commands to move around the linux directories, just the relevant git commands
Make your git command syntax as accurate as possible. If there is command syntax you can't remember precisely then use your best guess and mark it with an asterisk*.

Scenario:

  1. You have already performed your initial fork of the assignment using the command
    ssh -x csci fork csci265/assignG csci265/$USER/assignG
    Assuming you are in the subdirectory where you wish to put your repo, provide the git command to clone the fork you just created.

    Sample solution
    
    git clone csci:csci265/$USER/assignG
    

    (The remaining steps assume you're working in your cloned repo.)

  2. Supposing the instructor has plans to periodically make changes to the instructor repo for assignG on the csci server, provide three commands:
    - the first command is to create a remote named instructor for that instructor repo,
    - the second, assuming you're in the main branch now, is to create a branch named mywork,
    - the third is to switch to the branch you just created.
    (Don't pull anything from the remote yet.)

    Sample solution
    
    git remote add instructor csci:csci265/assignG
    git branch mywork
    git checkout mywork  (also accepted some variants that combine the last two instructions)
    

  3. Assuming you are still in your mywork branch and have now modified files X, Y, and Z, provide the sequence of git commands to get the X and Y (not Z) changes added and a new commit created. (Assume you provide sensible content for the commit message when it pops open an edit window, you don't need to provide that message content here.)

    Sample solution
    
    git add X
    git add Y
    git commit
    

  4. Now give the commands to switch to your main branch (which is still just the original repo content) and do a git pull from the instructor remote, to obtain any updates the instructor may have pushed.

    Sample solution
    
    git checkout main
    git pull instructor main
    

  5. Now, still assuming we're in the main branch, provide the command to initiate a merge of the committed contents of your mywork branch into the main branch.

    Sample solution
    
    git merge mywork
    

  6. Assuming there was a merge conflict in file X (i.e. both you and the instructor made changes to that file), outline the steps you would need to take to resolve the conflict.

    Sample solution
    
    The attempted merge will have modified the content of X to include the conflicting lines
    from both versions, separated and marked using the <<<<<< ===== and >>>>> lines.
    
    To resolve the conflict the dev should modify X to keep the desired content (some blend of
    the two versions presumably) and removing the lines of <<<<< ======== >>>>>>>.
    
    The merge will complete once the file has been saved with those lines removed.
    

  7. Finally, provide the command(s) needed to push the resulting main branch contents back to the repo you cloned from.

    Sample solution
    git push origin main
    (just git push would work too, since origin and main are the defaults for those arguments)