Fork me on GitHub

Tweets from last class and proposals

by Elliott Hauser

02 Apr 2014

Tweets

Nice work on this! I'm working on the tweethack repo as a project. Time for a demo.

Merge Conflicts

  1. Make a repo in a new foler
mkdir conflicts
cd conflicts
git init
  1. Make and checkout a new branch
git branch new
git checkout new
  1. Edit a file & commit the change
nano file.txt
# Edit the file (add your name perhaps) then press Ctrl-X and y to save
git add .
git commit -m "Made a change"
  1. Checkout original branch
git checkout master
  1. Edit and commit change to file.
nano file.txt
# Edit the file (add a **different** name) then press Ctrl-X and y to save
git add .
git commit -m "Made a second change"
  1. Try to Merge them
git merge new    # this means merge in the `new` branch
  1. Resolve conflicts

Basically, just make the file the way it should be, remove the <<<<<<<<<<<<<<<, ===============, and >>>>>>>>>>>>>>>>>>>>>> lines and you should be good to go!

  1. Commit & push resolution
git add .
git commit -m "Fixed conflict"

Branching

Always branch from the main branch! (gh-pages for our site; master for most repos)

Proposals

The proposal assignment is up, Due Sunday. We'll spend the balance of time in class workshopping a group's project and then working on the assignment.

Elliott Hauser is a PhD Student in information science at UNC Chapel Hill. He's hacking education as one of the cofounders of Trinket.io. Find Elliott Hauser on Twitter, Github, and on the web.
comments powered by Disqus