Day 28: Thursday, April 17, 2014

  1. Read See also
  2. Quiz on reading
  3. Discussion.
  4. Next week’s schedule: Tuesday (XSS and Selenium; DB; SIRS); Thursday (NastyGal, Grig Gheorghiu will speak via teleconf)
  5. This week’s homework will be: (a) finish out project points by Th; (b) fix stuff that I find in your homework, by following Th (two weeks).
  6. No class or final during final’s week!
  7. In class exercise on git merging.
  8. git merging prez

In class exercise: git merging

Brief description: check out cse491-mergez ( and merge the fix_stddev and listcomp branches into master.

Longer description:

This code implements the calculation of standard deviation for a discrete random variable (see the Wikipedia page), with values taken from a single column text file.

Two separate improvements have been made to the codebase. Please merge them into a single branch.

Note: Be sure to take the time to look through the project and repository!


  1. Clone the repository:

    git clone
  2. Get all of the branches:

    cd cse491-mergez
    git fetch origin
  3. Make sure you’re on master:

    git checkout master
  4. Get a list of branches, including remote ones:

    git branch -r
  5. Make a new merge branch to do the merge on:

    git checkout -b try_merge
  6. Merge in one of the two feature branches:

    git merge origin/listcomp

    and resolve merge conflicts, if any (see below).

  7. Merge in the other feature branch:

    git merge origin/fix_stddev

    and resolve merge conflicts, if any (see below).

  8. Go back to master.

    git checkout master
  9. Merge the ‘merge’ branch in:

    git merge try_merge
  10. (If you have time) Fork, push your master branch to your own copy, and set up a pull request from your master to my master.

  11. Bask in the warm glow of success.

Resolving merge conflicts

When git merge encounters syntactically unmergeable code – where one change directly conflicts with the other branch – it will annotate the code with both versions:

<<<< HEAD

 (one version of conflicting code)


 (other version of conflicting code)

>>>> other

To clear this conflict, you need to (a) edit the code so it is syntactically and semantically correct, which means removing the <<<< etc annotations; and (b) do a ‘git add filename’ for each file you fixed, plus a ‘git commit’ to commit the changes. Then a ‘git status’ should report no conflicted files.

Table Of Contents

Previous topic

Homework 13

Next topic

Day 27: Tuesday, April 15, 2014

This Page

Edit this document!

This file can be edited directly through the Web. Anyone can update and fix errors in this document with few clicks -- no downloads needed.

  1. Go to Day 28: Thursday, April 17, 2014 on GitHub.
  2. Edit files using GitHub's text editor in your web browser (see the 'Edit' tab on the top right of the file)
  3. Fill in the Commit message text box at the bottom of the page describing why you made the changes. Press the Propose file change button next to it when done.
  4. Then click Send a pull request.
  5. Your changes are now queued for review under the project's Pull requests tab on GitHub!

For an introduction to the documentation format please see the reST primer.