From 761281b835fb0c915299c5476ad1d4dd7e0d656d Mon Sep 17 00:00:00 2001 From: Jon Calder Date: Wed, 25 Jan 2017 13:15:17 +0200 Subject: [PATCH 1/6] Minor grammar and punctuation corrections. --- 10_connect-git-github.Rmd | 4 ++-- 12_connect-ssh-keys.Rmd | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/10_connect-git-github.Rmd b/10_connect-git-github.Rmd index 10ce793..4b0b0df 100644 --- a/10_connect-git-github.Rmd +++ b/10_connect-git-github.Rmd @@ -145,7 +145,7 @@ If you have made it this far, you are ready to graduate to using Git and GitHub It is likely that your first push, above, leads to a challenge for your GitHub username and password. -This will drive you crazy in the long-run and make you reluctant to push. Do one of the follow to eliminate this annoyance: +This will drive you crazy in the long-run and make you reluctant to push. Do one of the following to eliminate this annoyance: * Credential caching for HTTPS access, chapter \@ref(credential-caching). * Set up SSH keys, chapter \@ref(ssh-keys). @@ -154,7 +154,7 @@ Now is the perfect time to do this, since you have a functioning test repo. ## Clean up -**Local** When you're ready to clean up, you delete the local repo any way you like. It's just a regular directory on your computer. +**Local** When you're ready to clean up, you can delete the local repo any way you like. It's just a regular directory on your computer. Here's how to do that in the shell, if current working directory is `myrepo`: diff --git a/12_connect-ssh-keys.Rmd b/12_connect-ssh-keys.Rmd index b01e14e..1ebeb5f 100644 --- a/12_connect-ssh-keys.Rmd +++ b/12_connect-ssh-keys.Rmd @@ -4,7 +4,7 @@ If you plan to push/pull using SSH, you need to set up SSH keys. You want to do ## SSH keys -SSH keys provide a more secure way of logging into a server than using a password alone. While a password can eventually be cracked with a brute force attack, SSH keys are nearly impossible to decipher by brute force alone. Generating a key pair provides you with two long string of characters: a public and a private key. You can place the public key on any server, and then unlock it by connecting to it with a client that already has the private key. When the two match up, the system unlocks without the need for a password. You can increase security even more by protecting the private key with a passphrase. +SSH keys provide a more secure way of logging into a server than using a password alone. While a password can eventually be cracked with a brute force attack, SSH keys are nearly impossible to decipher by brute force alone. Generating a key pair provides you with two long strings of characters: a public and a private key. You can place the public key on any server, and then unlock it by connecting to it with a client that already has the private key. When the two match up, the system unlocks without the need for a password. You can increase security even more by protecting the private key with a passphrase. Adapted from instructions provided by [GitHub](https://help.github.com/categories/ssh/) and [Digital Ocean](https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2). @@ -119,4 +119,4 @@ Paste your key into the "Key" field. Click Add SSH key. -Confirm the action by entering your GitHub password +Confirm the action by entering your GitHub password. From 68cadf7de262ecb68135a36ffd2e7dfb71c20e28 Mon Sep 17 00:00:00 2001 From: Jon Calder Date: Wed, 25 Jan 2017 14:10:27 +0200 Subject: [PATCH 2/6] Further grammar and typo corrections --- 13_connect-rstudio-git-github.Rmd | 2 +- 14_connect-can-rstudio-use-git.Rmd | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/13_connect-rstudio-git-github.Rmd b/13_connect-rstudio-git-github.Rmd index 3554451..6ebd21e 100644 --- a/13_connect-rstudio-git-github.Rmd +++ b/13_connect-rstudio-git-github.Rmd @@ -92,7 +92,7 @@ Now is the perfect time to do this, since you have a functioning test repo. ## Clean up -**Local** When you're ready to clean up, you delete the local repo any way you like. It's just a regular directory on your computer. +**Local** When you're ready to clean up, you can delete the local repo any way you like. It's just a regular directory on your computer. **GitHub** In the browser, go to your repo's landing page on GitHub. Click on "Settings". diff --git a/14_connect-can-rstudio-use-git.Rmd b/14_connect-can-rstudio-use-git.Rmd index eb64ab2..d57f4b6 100644 --- a/14_connect-can-rstudio-use-git.Rmd +++ b/14_connect-can-rstudio-use-git.Rmd @@ -24,7 +24,7 @@ RStudio can only act as a GUI front-end for Git if Git has been successfully ins A basic test for successful installation of Git is to simply enter `git` in the shell. If you get a complaint about Git not being found, it means installation was unsuccessful or that it is not being found, i.e. it is not on your `PATH`. -If you are not sure where the Bit executable lives, try this in a shell: +If you are not sure where the Git executable lives, try this in a shell: * `which git` (Mac, Linux) @@ -45,11 +45,11 @@ From RStudio, go to *Tools > Global Options > Git/SVN* and make sure that the bo - __WARNING__: On Windows, do __NOT__ use `C:/Program Files (x86)/Git/cmd/git.exe`. `bin` in the path is GOOD YES! `cmd` in the path is BAD NO! - __WARNING__: On Windows, do __NOT__ use `git-bash.exe`. Something that ends in `git.exe` is GOOD YES! `git-bash.exe` is BAD NO! - * At times, we've had trouble navigating to the necessary directory on Mac OS, once we've clicked "Browse" and are working with a Finder-type window. The keyboard shortcut "command + shift + g" will summon "Go To Folder", where you will be able type or paste any path you want. + * At times, we've had trouble navigating to the necessary directory on Mac OS, once we've clicked "Browse" and are working with a Finder-type window. The keyboard shortcut "command + shift + g" will summon "Go To Folder", where you will be able to type or paste any path you want. **Restart RStudio if you make any changes.** Don't make me stop this car again and restart RStudio for you in office hours. DO IT. -Do the steps at the top of the page to see if RStudio and git are communicating now. +Do the steps at the top of the page to see if RStudio and Git are communicating now. No joy? From 258b29ad69eaa37aa770a99e48c1219ed7fa0be1 Mon Sep 17 00:00:00 2001 From: Jon Calder Date: Wed, 25 Jan 2017 13:15:17 +0200 Subject: [PATCH 3/6] Minor grammar and punctuation corrections. --- 10_connect-git-github.Rmd | 4 ++-- 12_connect-ssh-keys.Rmd | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/10_connect-git-github.Rmd b/10_connect-git-github.Rmd index 10ce793..4b0b0df 100644 --- a/10_connect-git-github.Rmd +++ b/10_connect-git-github.Rmd @@ -145,7 +145,7 @@ If you have made it this far, you are ready to graduate to using Git and GitHub It is likely that your first push, above, leads to a challenge for your GitHub username and password. -This will drive you crazy in the long-run and make you reluctant to push. Do one of the follow to eliminate this annoyance: +This will drive you crazy in the long-run and make you reluctant to push. Do one of the following to eliminate this annoyance: * Credential caching for HTTPS access, chapter \@ref(credential-caching). * Set up SSH keys, chapter \@ref(ssh-keys). @@ -154,7 +154,7 @@ Now is the perfect time to do this, since you have a functioning test repo. ## Clean up -**Local** When you're ready to clean up, you delete the local repo any way you like. It's just a regular directory on your computer. +**Local** When you're ready to clean up, you can delete the local repo any way you like. It's just a regular directory on your computer. Here's how to do that in the shell, if current working directory is `myrepo`: diff --git a/12_connect-ssh-keys.Rmd b/12_connect-ssh-keys.Rmd index b01e14e..1ebeb5f 100644 --- a/12_connect-ssh-keys.Rmd +++ b/12_connect-ssh-keys.Rmd @@ -4,7 +4,7 @@ If you plan to push/pull using SSH, you need to set up SSH keys. You want to do ## SSH keys -SSH keys provide a more secure way of logging into a server than using a password alone. While a password can eventually be cracked with a brute force attack, SSH keys are nearly impossible to decipher by brute force alone. Generating a key pair provides you with two long string of characters: a public and a private key. You can place the public key on any server, and then unlock it by connecting to it with a client that already has the private key. When the two match up, the system unlocks without the need for a password. You can increase security even more by protecting the private key with a passphrase. +SSH keys provide a more secure way of logging into a server than using a password alone. While a password can eventually be cracked with a brute force attack, SSH keys are nearly impossible to decipher by brute force alone. Generating a key pair provides you with two long strings of characters: a public and a private key. You can place the public key on any server, and then unlock it by connecting to it with a client that already has the private key. When the two match up, the system unlocks without the need for a password. You can increase security even more by protecting the private key with a passphrase. Adapted from instructions provided by [GitHub](https://help.github.com/categories/ssh/) and [Digital Ocean](https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2). @@ -119,4 +119,4 @@ Paste your key into the "Key" field. Click Add SSH key. -Confirm the action by entering your GitHub password +Confirm the action by entering your GitHub password. From a1f3972a8de7b0576d002c48badd8f739eca3cb4 Mon Sep 17 00:00:00 2001 From: Jon Calder Date: Wed, 25 Jan 2017 14:10:27 +0200 Subject: [PATCH 4/6] Further grammar and typo corrections --- 13_connect-rstudio-git-github.Rmd | 2 +- 14_connect-can-rstudio-use-git.Rmd | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/13_connect-rstudio-git-github.Rmd b/13_connect-rstudio-git-github.Rmd index 3554451..6ebd21e 100644 --- a/13_connect-rstudio-git-github.Rmd +++ b/13_connect-rstudio-git-github.Rmd @@ -92,7 +92,7 @@ Now is the perfect time to do this, since you have a functioning test repo. ## Clean up -**Local** When you're ready to clean up, you delete the local repo any way you like. It's just a regular directory on your computer. +**Local** When you're ready to clean up, you can delete the local repo any way you like. It's just a regular directory on your computer. **GitHub** In the browser, go to your repo's landing page on GitHub. Click on "Settings". diff --git a/14_connect-can-rstudio-use-git.Rmd b/14_connect-can-rstudio-use-git.Rmd index eb64ab2..d57f4b6 100644 --- a/14_connect-can-rstudio-use-git.Rmd +++ b/14_connect-can-rstudio-use-git.Rmd @@ -24,7 +24,7 @@ RStudio can only act as a GUI front-end for Git if Git has been successfully ins A basic test for successful installation of Git is to simply enter `git` in the shell. If you get a complaint about Git not being found, it means installation was unsuccessful or that it is not being found, i.e. it is not on your `PATH`. -If you are not sure where the Bit executable lives, try this in a shell: +If you are not sure where the Git executable lives, try this in a shell: * `which git` (Mac, Linux) @@ -45,11 +45,11 @@ From RStudio, go to *Tools > Global Options > Git/SVN* and make sure that the bo - __WARNING__: On Windows, do __NOT__ use `C:/Program Files (x86)/Git/cmd/git.exe`. `bin` in the path is GOOD YES! `cmd` in the path is BAD NO! - __WARNING__: On Windows, do __NOT__ use `git-bash.exe`. Something that ends in `git.exe` is GOOD YES! `git-bash.exe` is BAD NO! - * At times, we've had trouble navigating to the necessary directory on Mac OS, once we've clicked "Browse" and are working with a Finder-type window. The keyboard shortcut "command + shift + g" will summon "Go To Folder", where you will be able type or paste any path you want. + * At times, we've had trouble navigating to the necessary directory on Mac OS, once we've clicked "Browse" and are working with a Finder-type window. The keyboard shortcut "command + shift + g" will summon "Go To Folder", where you will be able to type or paste any path you want. **Restart RStudio if you make any changes.** Don't make me stop this car again and restart RStudio for you in office hours. DO IT. -Do the steps at the top of the page to see if RStudio and git are communicating now. +Do the steps at the top of the page to see if RStudio and Git are communicating now. No joy? From e4810272d89902237567a377f8ef8915c06d97be Mon Sep 17 00:00:00 2001 From: Jon Calder Date: Wed, 25 Jan 2017 16:54:27 +0200 Subject: [PATCH 5/6] More minor corrections, plus a note to encourage developing the habit of pulling before attempting to push. --- 15_install-connect-troubleshooting.Rmd | 2 +- 20_usage-new-project-github-first.Rmd | 8 +++++--- 21_usage-existing-project-github-first.Rmd | 8 +++++--- 22_usage-existing-project-github-last.Rmd | 8 +++++--- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/15_install-connect-troubleshooting.Rmd b/15_install-connect-troubleshooting.Rmd index 3bafa6c..a35dae8 100644 --- a/15_install-connect-troubleshooting.Rmd +++ b/15_install-connect-troubleshooting.Rmd @@ -102,6 +102,6 @@ If you cannot deal with the two root causes identified above, then it is possibl Do not create a Git repository inside another Git repository. Just don't. -If you have a genuine need for this, which is really rare, the proper way to do is is via [submodules](http://git-scm.com/book/en/v2/Git-Tools-Submodules). +If you have a genuine need for this, which is really rare, the proper way to do it is via [submodules](http://git-scm.com/book/en/v2/Git-Tools-Submodules). In STAT 545, we certainly do not need to do this and when we've seen it, it's been a mistake. This has resulted in the unexpected and complete loss of the inner Git repository. To be sure, there was more going on here (cough, GitHub Desktop client), but non-standard usage of Git repos makes it much easier to make costly mistakes. diff --git a/20_usage-new-project-github-first.Rmd b/20_usage-new-project-github-first.Rmd index 8c63864..bc57d4f 100644 --- a/20_usage-new-project-github-first.Rmd +++ b/20_usage-new-project-github-first.Rmd @@ -18,7 +18,7 @@ Repository name: `myrepo` (or whatever you wish) Public YES Initialize this repository with a README -Click big green button "Create repository." +Click the big green button "Create repository." Copy the HTTPS clone URL to your clipboard via the green "Clone or Download" button. Or copy the SSH URL if you chose to set up SSH keys. @@ -95,7 +95,7 @@ Add a line to this file, such as "Line added from GitHub." Edit the commit message in "Commit changes" or accept the default. -Click big green button "Commit changes." +Click the big green button "Commit changes." ## Pull from GitHub @@ -109,4 +109,6 @@ Look at README.md again. You should now see the new line there. ## The end -Now just ... repeat. Do work somewhere. Commit it. Push it or pull it depending on where you did it, but get local and remote "synced up". Repeat. +Now just ... repeat. Do work somewhere. Commit it. Push it or pull it\* depending on where you did it, but get local and remote "synced up". Repeat. + +\* Note that in general (and especially in future when collaborating with other developers) you will usually need to pull changes from the remote (GitHub) before pushing the local changes you have made. For this reaon, it's a good idea to try and get into the habit of pulling before you attempt to push. diff --git a/21_usage-existing-project-github-first.Rmd b/21_usage-existing-project-github-first.Rmd index 336a848..39f65c1 100644 --- a/21_usage-existing-project-github-first.Rmd +++ b/21_usage-existing-project-github-first.Rmd @@ -10,14 +10,14 @@ We assume you've got your existing R project isolated in a directory on your com Go to and make sure you are logged in. -Click green "New repository" button. Or, if you are on your own profile page, click on "Repositories", then click the green "New" button. +Click the green "New repository" button. Or, if you are on your own profile page, click on "Repositories", then click the green "New" button. Pick a repository name that actually reminds you what the project is about! But try to be concise. Public YES Initialize this repository with a README -Click big green button "Create repository." +Click the big green button "Create repository." Copy the HTTPS clone URL to your clipboard via the green "Clone or Download" button. Or copy the SSH URL if you chose to set up SSH keys. @@ -79,4 +79,6 @@ If you click on "commits," you should see one with the message "init". ## The end -Now just ... repeat. Do work somewhere. Commit it. Push it or pull it depending on where you did it, but get local and remote "synced up". Repeat. +Now just ... repeat. Do work somewhere. Commit it. Push it or pull it\* depending on where you did it, but get local and remote "synced up". Repeat. + +\* Note that in general (and especially in future when collaborating with other developers) you will usually need to pull changes from the remote (GitHub) before pushing the local changes you have made. For this reaon, it's a good idea to try and get into the habit of pulling before you attempt to push. diff --git a/22_usage-existing-project-github-last.Rmd b/22_usage-existing-project-github-last.Rmd index e3042aa..dc45ded 100644 --- a/22_usage-existing-project-github-last.Rmd +++ b/22_usage-existing-project-github-last.Rmd @@ -45,14 +45,14 @@ If your local project was already a Git repo and was up-to-date, move on. Otherw Go to and make sure you are logged in. -Click green "New repository" button. Or, if you are on your own profile page, click on "Repositories", then click the green "New" button. +Click the green "New repository" button. Or, if you are on your own profile page, click on "Repositories", then click the green "New" button. Pick a repository name -- it should probably match the name of your local Project and directory. Why confuse yourself? Public or private, as appropriate and possible DO NOT initialize this repository with a README. -Click big green button "Create repository." +Click the big green button "Create repository." Copy the HTTPS clone URL to your clipboard via the green "Clone or Download" button. Or copy the SSH URL if you chose to set up SSH keys. @@ -78,4 +78,6 @@ If you click on "commits," you should see one with the message "init". ## The end -Now just ... repeat. Do work somewhere. Commit it. Push it or pull it depending on where you did it, but get local and remote "synced up". Repeat. +Now just ... repeat. Do work somewhere. Commit it. Push it or pull it\* depending on where you did it, but get local and remote "synced up". Repeat. + +\* Note that in general (and especially in future when collaborating with other developers) you will usually need to pull changes from the remote (GitHub) before pushing the local changes you have made. For this reaon, it's a good idea to try and get into the habit of pulling before you attempt to push. From 74b126db4088d728fde8f543964fb88b77922eec Mon Sep 17 00:00:00 2001 From: Jon Calder Date: Fri, 27 Jan 2017 13:51:00 +0200 Subject: [PATCH 6/6] Grammar corrections --- 31_workflow-first-use-r-script-and-github.Rmd | 2 +- 44_prompt-practice-resets.Rmd | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/31_workflow-first-use-r-script-and-github.Rmd b/31_workflow-first-use-r-script-and-github.Rmd index 5d45451..92cff60 100644 --- a/31_workflow-first-use-r-script-and-github.Rmd +++ b/31_workflow-first-use-r-script-and-github.Rmd @@ -2,7 +2,7 @@ An underappreciated fact is that much of what you can do with R Markdown, you can also do with an R script. -If you're in analysis mode and want a report as a side effect, write an R script. If you're writing a report with a lot of R code in it, write Rmd. In either case, render to markdown and/or HTML to communicate with other humans beings. +If you're in analysis mode and want a report as a side effect, write an R script. If you're writing a report with a lot of R code in it, write Rmd. In either case, render to markdown and/or HTML to communicate with other human beings. * In R markdown, prose is top-level and code is tucked into chunks. * In R scripts, code is top-level and prose is tucked into comments. You will use `#'` to request that certain comments appear as top-level prose in the rendered output. diff --git a/44_prompt-practice-resets.Rmd b/44_prompt-practice-resets.Rmd index 9f6524c..939bd54 100644 --- a/44_prompt-practice-resets.Rmd +++ b/44_prompt-practice-resets.Rmd @@ -2,7 +2,7 @@ Practice recovering from mistakes. -Use a repository you've create earlier in tutorial for this. It only needs to be local, i.e. this does not involve GitHub. +Use a repository you've created earlier in the tutorial for this. It only needs to be local, i.e. this does not involve GitHub. If it's not your most recent commit, seriously consider just letting that go. Just. Let. It. Go. @@ -14,7 +14,7 @@ If "YES undo the commit, but leave the files in that state (but unstaged)": `git If "YES go right back to the moment before I committed": `git reset --soft HEAD^`. Your files will stay the same but the commit will be undone. Even your staged changes will be restored. -**If you just want to fiddle the most recent commit or its message, you can amend it. You can do this from RStudio!** +**If you just want to fiddle with the most recent commit or its message, you can amend it. You can do this from RStudio!** * Make the change you want and amend the commit. * Do you only want to change the commit message?