git & github

ben best | ucsb data science

2015-07-16 | bbest.github.io/ds-git

introduction

outline

  1. introduction
    • why bother?
    • workflow
    • fork & pull model
    • github features
  2. exercises
    1. hello world
      • http://github.com/[user]/hello-world
    2. create a website repo
      • http://[user].github.io
    3. fork & pull a repo
      • stevejbrown/rss_article_recommender

why bother?

example workflow

  1. sign up at github.com (1x/user)
  2. install git (1x/machine)
  3. create [or fork] a repository, aka "repo" (1x/repo)
  4. clone from web to your local desktop (1x/repo)
  5. [branch copy for isolated development of a feature (1x/feature)]
  6. commit changes locally
  7. push changes to your repo
  8. [pull request changes from your repo to source repo that was forked)]

models of development

fork & pull model

github.com/[user0]/[repo]
(orig, web)
github.com/[user]/[repo]
(you, web)
~/github/[repo]
(you, local)
(1x) fork clone
commit
branch
push
merge pull request

where:

github features

github rendering: text

Track Changes view with "Rendered" button to view differences between versions of a text file: additions in green, removals in red strikethrough. Details: Rendering differences in prose documents

Source

Source

Rendered

Rendered

github rendering: images

Image view show differences in 3 ways: 2-up, swipe and onion skin views. Details: Rendering and diffing images