Git vs. GitHub

  1. Share your repositories with others
  2. Access other users’ repositories
  3. Store remote copies of your repositories (on GitHub’s server) in case something happens to your local copies (on your computer)

Creating a GitHub Repository

  1. Start a repository from scratch
  2. “Fork” another user’s repository

Start a Repository From Scratch

…OR…


Start a Repository From Scratch


Start a Repository From Scratch


Creating a Local Copy

$ mkdir ~/test-repo
$ cd ~/test-repo

Creating a Local Copy

$ git init
$ git remote add origin https://github.com/your-user-name-goes-here/test-repo.git


Creating a Local Copy


Fork a Another User’s Repository

https://help.github.com/articles/fork-a-repo


Clone the Repo

$ git clone https://github.com/your-user-name-goes-here/repo-name-here.git

What Else?

An example workflow


Create a new repo on GitHub


Copy repo URL to clipboard


Create a new local directory


Create a new file in directory



Create a new repo locally


Stage file for commit


Commit changes


Check log


Push changes to GitHub


Check status


Check GitHub


Add README file from GitHub


Edit README file from GitHub




Fetch changes from GitHub


Merge changes into local repo


Check status

So you’ve got a repo…. Now what?


Pushing and Pulling

http://gitready.com/beginner/2009/01/21/pushing-and-pulling.html


Adding


Committing


Log


Pushing


Pull Requests


Time to be a hacker!

What is Markdown?


What is R Markdown?


What is R Markdown?