diff --git a/_episodes/02-setup.md b/_episodes/02-setup.md index 58bb376..2ca54ad 100644 --- a/_episodes/02-setup.md +++ b/_episodes/02-setup.md @@ -22,16 +22,24 @@ of configurations we will set as we get started with Git: On a command line, Git commands are written as `git verb`, where `verb` is what we actually want to do. So here is how -Dracula sets up his new laptop: +Jane sets up her new laptop: ~~~ -$ git config --global user.name "Vlad Dracula" -$ git config --global user.email "vlad@tran.sylvan.ia" +$ git config --global user.name "Jane Smith" +$ git config --global user.email "jane.smith@university.ac.uk" $ git config --global color.ui "auto" ~~~ {: .bash} -Please use your own name and email address instead of Dracula's. This user name and email will be associated with your subsequent Git activity, +We're using a Linux 'virtual machine' today which has the command line tools for Git already installed, but Git can be used equally well on a Mac or a Windows computer: + +[Git setup for Mac](https://www.codecademy.com/articles/git-setup) +[Git and Git Bash setup for Windows](https://www.codecademy.com/articles/command-line-setup) + + +Please use your own name and email address instead of Jane's. Later on in this workshop, we'll be setting up an account on Github so make sure you use the **same** email address. We recommend that you use your institutional email address. + +This user name and email will be associated with your subsequent Git activity, which means that any changes pushed to [GitHub](https://github.com/), [BitBucket](https://bitbucket.org/), @@ -41,14 +49,14 @@ in a later lesson will include this information. > ## Line Endings > -> As with other keys, when you hit the 'return' key on your keyboard, -> your computer encodes this input. +> As with other keys, when you hit the 'return' key on your keyboard, +> your computer encodes this input. > For reasons that are long to explain, different operating systems -> use different character(s) to represent the end of a line. +> use different character(s) to represent the end of a line. > (You may also hear these referred to as newlines or line breaks.) -> Because git uses these characters to compare files, -> it may cause unexpected issues when editing a file on different machines. -> +> Because git uses these characters to compare files, +> it may cause unexpected issues when editing a file on different machines. +> > You can change the way git recognizes and encodes line endings > using the `core.autocrlf` command to `git config`. > The following settings are recommended: @@ -66,15 +74,15 @@ in a later lesson will include this information. > $ git config --global core.autocrlf true > ~~~ > {: .bash} -> -> You can read more about this issue +> +> You can read more about this issue > [on this GitHub page](https://help.github.com/articles/dealing-with-line-endings/). {: .callout} -For these lessons, we will be interacting with [GitHub](https://github.com/) and so the email address used should be the same as the one used when setting up your GitHub account. If you are concerned about privacy, please review [GitHub's instructions for keeping your email address private][git-privacy]. +For these lessons, we will be interacting with [GitHub](https://github.com/) and so the email address used should be the same as the one used when setting up your GitHub account. If you are concerned about privacy, please review [GitHub's instructions for keeping your email address private][git-privacy]. If you elect to use a private email address with GitHub, then use that same email address for the `user.email` value, e.g. `username@users.noreply.github.com` replacing `username` with your GitHub one. You can change the email address later on by using the `git config` command again. -Dracula also has to set his favorite text editor, following this table: +Jane also has to set her favorite text editor, following this table: | Editor | Configuration command | |:-------------------|:-------------------------------------------------| diff --git a/_episodes/03-create.md b/_episodes/03-create.md index 167fe9f..4de62fd 100644 --- a/_episodes/03-create.md +++ b/_episodes/03-create.md @@ -15,12 +15,12 @@ we can start using it. Let's create a directory for our work and then move into that directory: ~~~ -$ mkdir planets -$ cd planets +$ mkdir inflammation +$ cd inflammation ~~~ {: .bash} -Then we tell Git to make `planets` a [repository]({{ page.root }}/reference/#repository)—a place where +Then we tell Git to make `inflammation` a [repository]({{ page.root }}/reference/#repository)—a place where Git can store versions of our files: ~~~ @@ -75,23 +75,23 @@ nothing to commit (create/copy files and use "git add" to track) > ## Places to Create Git Repositories > -> Dracula starts a new project, `moons`, related to his `planets` project. -> Despite Wolfman's concerns, he enters the following sequence of commands to +> Jane starts a new project, `infection`, related to her `inflammation` project. +> Despite Samit's concerns, ahe enters the following sequence of commands to > create one Git repository inside another: > > ~~~ -> $ cd # return to home directory -> $ mkdir planets # make a new directory planets -> $ cd planets # go into planets -> $ git init # make the planets directory a Git repository -> $ mkdir moons # make a sub-directory planets/moons -> $ cd moons # go into planets/moons -> $ git init # make the moons sub-directory a Git repository +> $ cd # return to home directory +> $ mkdir inflammation # make a new directory inflammation +> $ cd inflammation # go into inflammation +> $ git init # make the inflammation directory a Git repository +> $ mkdir infections # make a sub-directory inflammation/infection +> $ cd infection # go into inflammation/infection +> $ git init # make the infection sub-directory a Git repository > ~~~ > {: .bash} > -> Why is it a bad idea to do this? (Notice here that the `planets` project is now also tracking the entire `moons` repository.) -> How can Dracula undo his last `git init`? +> Why is it a bad idea to do this? (Notice here that the `inflammation` project is now also tracking the entire `infection` repository.) +> How can Jane undo her last `git init`? > > > ## Solution > > @@ -112,19 +112,19 @@ nothing to commit (create/copy files and use "git add" to track) > > ~~~ > > {: .output} > > -> > Note that we can track files in directories within a Git: +> > Note that we can track files in directories within a Git repository: > > > > ~~~ -> > $ touch moon phobos deimos titan # create moon files -> > $ cd .. # return to planets directory -> > $ ls moons # list contents of the moons directory -> > $ git add moons/* # add all contents of planets/moons -> > $ git status # show moons files in staging area -> > $ git commit -m "add moon files" # commit planets/moons to planets Git repository +> > $ touch patient1 patient2 patient3 patient4 # create infection files +> > $ cd .. # return to infection directory +> > $ ls infection # list contents of the infection directory +> > $ git add infection/* # add all contents of inflammation/infection +> > $ git status # show infection files in staging area +> > $ git commit -m "add patient files" # commit inflammation/infection to inflammation Git repository > > ~~~ > > {: .bash} > > -> > Similarly, we can ignore (as discussed later) entire directories, such as the `moons` directory: +> > Similarly, we can ignore (as discussed later) entire directories, such as the `infection` directory: > > > > ~~~ > > $ nano .gitignore # open the .gitignore file in the text editor to add the moons directory @@ -133,15 +133,15 @@ nothing to commit (create/copy files and use "git add" to track) > > {: .bash} > > > > ~~~ -> > moons +> > infection > > ~~~ > > {: .output} > > -> > To recover from this little mistake, Dracula can just remove the `.git` -> > folder in the moons subdirectory. To do so he can run the following command from inside the 'moons' directory: +> > To recover from this little mistake, Jane can just remove the `.git` +> > folder in the `infection` subdirectory. To do so she can run the following command from inside the `infection` directory: > > > > ~~~ -> > $ rm -rf moons/.git +> > $ rm -rf .git > > ~~~ > > {: .bash} > > diff --git a/_episodes/04-changes.md b/_episodes/04-changes.md index 3e08b3b..8f1a7cd 100644 --- a/_episodes/04-changes.md +++ b/_episodes/04-changes.md @@ -19,39 +19,39 @@ keypoints: --- First let's make sure we're still in the right directory. -You should be in the `planets` directory. +You should be in the `inflammation` directory. ~~~ $ pwd ~~~ {: .bash} -If you are still in `moons` navigate back up to `planets` +If you are still in `infection` navigate back up to `inflammation` ~~~ $ cd .. ~~~ {: .bash} -Let's create a file called `mars.txt` that contains some notes -about the Red Planet's suitability as a base. -We'll use `nano` to edit the file; -you can use whatever editor you like. +Let's create a file called `project.txt` that contains some notes +about what we plan to do in this project. +We'll use `nano` to edit the file but you can use whatever editor you like. + In particular, this does not have to be the `core.editor` you set globally earlier. But remember, the bash command to create or edit a new file will depend on the editor you choose (it might not be `nano`). For a refresher on text editors, check out ["Which Editor?"](https://swcarpentry.github.io/shell-novice/03-create/) in [The Unix Shell](https://swcarpentry.github.io/shell-novice/) lesson. ~~~ -$ nano mars.txt +$ nano project.txt ~~~ {: .bash} -Type the text below into the `mars.txt` file: +Type the text below into the `project.txt` file: ~~~ -Cold and dry, but everything is my favorite color +Some initial data analysis to identify how inflammation changes over time after surgery. ~~~ {: .output} -`mars.txt` now contains a single line, which we can see by running: +`project.txt` now contains a single line, which we can see by running: ~~~ $ ls @@ -59,22 +59,21 @@ $ ls {: .bash} ~~~ -mars.txt +project.txt ~~~ {: .output} ~~~ -$ cat mars.txt +$ cat project.txt ~~~ {: .bash} ~~~ -Cold and dry, but everything is my favorite color +Some initial data analysis to identify how inflammation changes over time after surgery. ~~~ {: .output} -If we check the status of our project again, -Git tells us that it's noticed the new file: +Now, if we check the status of our project again, Git tells us that it's noticed the new file: ~~~ $ git status @@ -87,9 +86,10 @@ On branch master Initial commit Untracked files: - (use "git add ..." to include in what will be committed) + (use "git add ..." to include in what will be committed) + + project.txt - mars.txt nothing added to commit but untracked files present (use "git add" to track) ~~~ {: .output} @@ -99,7 +99,7 @@ that Git isn't keeping track of. We can tell Git to track a file using `git add`: ~~~ -$ git add mars.txt +$ git add project.txt ~~~ {: .bash} @@ -118,25 +118,26 @@ Initial commit Changes to be committed: (use "git rm --cached ..." to unstage) - new file: mars.txt + new file: project.txt ~~~ {: .output} -Git now knows that it's supposed to keep track of `mars.txt`, +Git now knows that it's supposed to keep track of `project.txt`, but it hasn't recorded these changes as a commit yet. To get it to do that, we need to run one more command: ~~~ -$ git commit -m "Start notes on Mars as a base" +$ git commit -m "Start notes on the patient inflammation project" ~~~ {: .bash} ~~~ -[master (root-commit) f22b25e] Start notes on Mars as a base +[[master (root-commit) 40b8a94] Start notes on the patient inflammation project 1 file changed, 1 insertion(+) - create mode 100644 mars.txt + create mode 100644 project.txt + ~~~ {: .output} @@ -155,7 +156,7 @@ so that we can write a longer message. [Good commit messages][commit-messages] start with a brief (<50 characters) summary of changes made in the commit. If you want to go into more detail, add -a blank line between the summary line and your additional notes. +a blank line between the summary line and your additional notes. They are usually written in the present tense. If we run `git status` now: @@ -166,7 +167,8 @@ $ git status ~~~ On branch master -nothing to commit, working directory clean +nothing to commit, working tree clean + ~~~ {: .output} @@ -180,11 +182,12 @@ $ git log {: .bash} ~~~ -commit f22b25e3233b4645dabd0d81e651fe074bd8e73b -Author: Vlad Dracula -Date: Thu Aug 22 09:51:46 2013 -0400 +commit 40b8a9400329ed7324116cc9392dc8e4842d8501 (HEAD -> master) +Author: Jane Smith +Date: Wed Jan 3 10:34:07 2018 +0000 + + Start notes on the patient inflammation project - Start notes on Mars as a base ~~~ {: .output} @@ -199,26 +202,27 @@ and the log message Git was given when the commit was created. > ## Where Are My Changes? > -> If we run `ls` at this point, we will still see just one file called `mars.txt`. +> If we run `ls` at this point, we will still see just one file called `project.txt`. > That's because Git saves information about files' history > in the special `.git` directory mentioned earlier > so that our filesystem doesn't become cluttered > (and so that we can't accidentally edit or delete an old version). {: .callout} -Now suppose Dracula adds more information to the file. +Now suppose Jane adds more information to the file. (Again, we'll edit with `nano` and then `cat` the file to show its contents; you may use a different editor, and don't need to `cat`.) ~~~ -$ nano mars.txt -$ cat mars.txt +$ nano project.txt +$ cat project.txt ~~~ {: .bash} ~~~ -Cold and dry, but everything is my favorite color -The two moons may be a problem for Wolfman +Some initial data analysis to identify how inflammation changes over time after surgery. +Jane is a Data Scientist and Samit is a statistician. We'll need to determine +who is responsible for what in this project. ~~~ {: .output} @@ -236,7 +240,7 @@ Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) - modified: mars.txt + modified: project.txt no changes added to commit (use "git add" and/or "git commit -a") ~~~ @@ -259,13 +263,14 @@ $ git diff {: .bash} ~~~ -diff --git a/mars.txt b/mars.txt -index df0654a..315bf3a 100644 ---- a/mars.txt -+++ b/mars.txt -@@ -1 +1,2 @@ - Cold and dry, but everything is my favorite color -+The two moons may be a problem for Wolfman +diff --git a/project.txt b/project.txt +index 17e2b79..2485f1d 100644 +--- a/project.txt ++++ b/project.txt +@@ -1 +1,3 @@ + Some initial data analysis to identify how inflammation changes over time after surgery. ++Jane is a Data Scientist and Samit is a statistician. We'll need to determine ++who is responsible for what in this project. ~~~ {: .output} @@ -278,17 +283,17 @@ If we break it down into pieces: comparing the old and new versions of the file. 2. The second line tells exactly which versions of the file Git is comparing; - `df0654a` and `315bf3a` are unique computer-generated labels for those versions. + `17e2b79` and `2485f1d` are unique computer-generated labels for those versions. 3. The third and fourth lines once again show the name of the file being changed. 4. The remaining lines are the most interesting, they show us the actual differences and the lines on which they occur. In particular, - the `+` marker in the first column shows where we added a line. + the `+` marker in the first column shows where we added new lines. After reviewing our change, it's time to commit it: ~~~ -$ git commit -m "Add concerns about effects of Mars' moons on Wolfman" +$ git commit -m "Add note about project responsibilities" $ git status ~~~ {: .bash} @@ -299,7 +304,7 @@ Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) - modified: mars.txt + modified: project.txt no changes added to commit (use "git add" and/or "git commit -a") ~~~ @@ -310,14 +315,15 @@ Git won't commit because we didn't use `git add` first. Let's fix that: ~~~ -$ git add mars.txt -$ git commit -m "Add concerns about effects of Mars' moons on Wolfman" +$ git add project.txt +$ git commit -m "Add note about project responsibilities" ~~~ {: .bash} ~~~ -[master 34961b1] Add concerns about effects of Mars' moons on Wolfman - 1 file changed, 1 insertion(+) +[master 71ed26a] Add note about project responsibilities + 1 file changed, 2 insertions(+) + ~~~ {: .output} @@ -355,7 +361,7 @@ but not yet committed. > the stage for the snapshot because you used `-a`!) > Try to stage things manually, > or you might find yourself searching for "git undo commit" more -> than you would like! +> than you would like. {: .callout} ![The Git Staging Area](../fig/git-staging-area.svg) @@ -367,15 +373,16 @@ First, we'll add another line to the file: ~~~ -$ nano mars.txt -$ cat mars.txt +$ nano project.txt +$ cat project.txt ~~~ {: .bash} ~~~ -Cold and dry, but everything is my favorite color -The two moons may be a problem for Wolfman -But the Mummy will appreciate the lack of humidity +Some initial data analysis to identify how inflammation changes over time after surgery. +Jane is a Data Scientist and Samit is a statistician. We'll need to determine +who is responsible for what in this project. +We may need to bring a third person with Python programming skills into the project. ~~~ {: .output} @@ -385,14 +392,15 @@ $ git diff {: .bash} ~~~ -diff --git a/mars.txt b/mars.txt -index 315bf3a..b36abfd 100644 ---- a/mars.txt -+++ b/mars.txt -@@ -1,2 +1,3 @@ - Cold and dry, but everything is my favorite color - The two moons may be a problem for Wolfman -+But the Mummy will appreciate the lack of humidity +diff --git a/project.txt b/project.txt +index 2485f1d..3f80947 100644 +--- a/project.txt ++++ b/project.txt +@@ -1,3 +1,4 @@ + Some initial data analysis to identify how inflammation changes over time after surgery. + Jane is a Data Scientist and Samit is a statistician. We'll need to determine + who is responsible for what in this project. ++We may need to bring a third person with Python programming skills into the project. ~~~ {: .output} @@ -403,7 +411,7 @@ Now let's put that change in the staging area and see what `git diff` reports: ~~~ -$ git add mars.txt +$ git add project.txt $ git diff ~~~ {: .bash} @@ -421,14 +429,15 @@ $ git diff --staged {: .bash} ~~~ -diff --git a/mars.txt b/mars.txt -index 315bf3a..b36abfd 100644 ---- a/mars.txt -+++ b/mars.txt -@@ -1,2 +1,3 @@ - Cold and dry, but everything is my favorite color - The two moons may be a problem for Wolfman -+But the Mummy will appreciate the lack of humidity +diff --git a/project.txt b/project.txt +index 2485f1d..3f80947 100644 +--- a/project.txt ++++ b/project.txt +@@ -1,3 +1,4 @@ + Some initial data analysis to identify how inflammation changes over time after surgery. + Jane is a Data Scientist and Samit is a statistician. We'll need to determine + who is responsible for what in this project. ++We may need to bring a third person with Python programming skills into the project. ~~~ {: .output} @@ -438,12 +447,12 @@ and what's in the staging area. Let's save our changes: ~~~ -$ git commit -m "Discuss concerns about Mars' climate for Mummy" +$ git commit -m "Add note about extra team members" ~~~ {: .bash} ~~~ -[master 005937f] Discuss concerns about Mars' climate for Mummy +[master 005937f] Add note about extra team members 1 file changed, 1 insertion(+) ~~~ {: .output} @@ -469,23 +478,23 @@ $ git log {: .bash} ~~~ -commit 005937fbe2a98fb83f0ade869025dc2636b4dad5 -Author: Vlad Dracula -Date: Thu Aug 22 10:14:07 2013 -0400 +commit 63f6bc6039c12ce897cf3f02bda1e95fd30fef58 (HEAD -> master) +Author: Jane Smith +Date: Wed Jan 3 10:42:09 2018 +0000 - Discuss concerns about Mars' climate for Mummy + Add note about extra team members -commit 34961b159c27df3b475cfe4415d94a6d1fcd064d -Author: Vlad Dracula -Date: Thu Aug 22 10:07:21 2013 -0400 +commit 71ed26a8f840d2929f5120327ea0accd55074070 +Author: Jane Smith +Date: Wed Jan 3 10:39:19 2018 +0000 - Add concerns about effects of Mars' moons on Wolfman + Add note about project responsibilities -commit f22b25e3233b4645dabd0d81e651fe074bd8e73b -Author: Vlad Dracula -Date: Thu Aug 22 09:51:46 2013 -0400 +commit 40b8a9400329ed7324116cc9392dc8e4842d8501 +Author: Jane Smith +Date: Wed Jan 3 10:34:07 2018 +0000 - Start notes on Mars as a base + Start notes on the patient inflammation project ~~~ {: .output} @@ -523,11 +532,11 @@ Date: Thu Aug 22 09:51:46 2013 -0400 > {: .bash} > > ~~~ -> commit 005937fbe2a98fb83f0ade869025dc2636b4dad5 -> Author: Vlad Dracula -> Date: Thu Aug 22 10:14:07 2013 -0400 +> commit 63f6bc6039c12ce897cf3f02bda1e95fd30fef58 (HEAD -> master) +> Author: Jane Smith +> Date: Wed Jan 3 10:42:09 2018 +0000 > -> Discuss concerns about Mars' climate for Mummy +> Add note about extra team members > ~~~ > {: .output} > @@ -539,9 +548,9 @@ Date: Thu Aug 22 09:51:46 2013 -0400 > ~~~ > {: .bash} > ~~~ -> * 005937f Discuss concerns about Mars' climate for Mummy -> * 34961b1 Add concerns about effects of Mars' moons on Wolfman -> * f22b25e Start notes on Mars as a base +> 63f6bc6 (HEAD -> master) Add note about extra team members +> 71ed26a Add note about project responsibilities +> 40b8a94 Start notes on the patient inflammation project > ~~~ > {: .output} > @@ -553,9 +562,9 @@ Date: Thu Aug 22 09:51:46 2013 -0400 > ~~~ > {: .bash} > ~~~ -> * 005937f Discuss concerns about Mars' climate for Mummy (HEAD, master) -> * 34961b1 Add concerns about effects of Mars' moons on Wolfman -> * f22b25e Start notes on Mars as a base +> * 63f6bc6 (HEAD -> master) Add note about extra team members +> * 71ed26a Add note about project responsibilities +> * 40b8a94 Start notes on the patient inflammation project > ~~~ > {: .output} {: .callout} @@ -603,11 +612,11 @@ repository (`git commit`): > ## Choosing a Commit Message > > Which of the following commit messages would be most appropriate for the -> last commit made to `mars.txt`? +> last commit made to `project.txt`? > > 1. "Changes" -> 2. "Added line 'But the Mummy will appreciate the lack of humidity' to mars.txt" -> 3. "Discuss effects of Mars' climate on the Mummy" +> 2. "Added line 'We discussed who might be responsible for what' to project.txt" +> 3. "Add note about project responsibilities" > > > ## Solution > > Answer 1 is not descriptive enough, @@ -645,56 +654,56 @@ repository (`git commit`): > The staging area can hold changes from any number of files > that you want to commit as a single snapshot. > -> 1. Add some text to `mars.txt` noting your decision -> to consider Venus as a base -> 2. Create a new file `venus.txt` with your initial thoughts -> about Venus as a base for you and your friends +> 1. Add some text to `project.txt` noting your decision +> on what a third tem member might be resposnible for. +> 2. Create a new file `analysis.txt` with your initial thoughts +> about what data would be useful for your analysis project > 3. Add changes from both files to the staging area, > and commit those changes. > > > ## Solution > > -> > First we make our changes to the `mars.txt` and `venus.txt` files: +> > First we make our changes to the `project.txt` and `analysis.txt` files: > > ~~~ -> > $ nano mars.txt -> > $ cat mars.txt +> > $ nano project.txt +> > $ cat project.txt > > ~~~ > > {: .bash} > > ~~~ -> > Maybe I should start with a base on Venus. +> > The third team member needs to be competent in both Python and R. They +> > also need to be familiar with matplotlib and ggplot > > ~~~ > > {: .output} > > ~~~ -> > $ nano venus.txt -> > $ cat venus.txt +> > $ nano analysis.txt +> > $ cat analysis.txt > > ~~~ > > {: .bash} > > ~~~ -> > Venus is a nice planet and I definitely should consider it as a base. +> > We need data about patients, wards, dates, temperatures and inflammation size > > ~~~ > > {: .output} > > Now you can add both files to the staging area. We can do that in one line: > > > > ~~~ -> > $ git add mars.txt venus.txt +> > $ git add project.txt analysis.txt > > ~~~ > > {: .bash} > > Or with multiple commands: > > ~~~ -> > $ git add mars.txt -> > $ git add venus.txt +> > $ git add project.txt +> > $ git add analysis.txt > > ~~~ > > {: .bash} > > Now the files are ready to commit. You can check that using `git status`. If you are ready to commit use: > > ~~~ -> > $ git commit -m "Write plans to start a base on Venus" +> > $ git commit -m "Add note about what data would be useful" > > ~~~ > > {: .bash} > > ~~~ -> > [master cc127c2] -> > Write plans to start a base on Venus -> > 2 files changed, 2 insertions(+) -> > create mode 100644 venus.txt +> > [master a264d5c] Add note about what data would be useful +> > 2 files changed, 3 insertions(+) +> > create mode 100644 analysis.txt > > ~~~ > > {: .output} > {: .solution} @@ -715,7 +724,7 @@ repository (`git commit`): > When committing you can name someone else as the author: > > ~~~ -> $ git commit --author="Vlad Dracula " +> $ git commit --author="Samit Patel " > ~~~ > {: .bash} > @@ -728,26 +737,26 @@ repository (`git commit`): > > > > ~~~ > > $ git add me.txt -> > $ git commit -m "Update Vlad's bio." --author="Frank N. Stein " +> > $ git commit -m "Update Jane's bio." --author="Pete Jones " > > ~~~ > > {: .bash} > > ~~~ -> > [master 4162a51] Update Vlad's bio. -> > Author: Frank N. Stein +> > [master 4162a51] Update Jane's bio. +> > Author: Pete Jones > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > $ git log --format=full > > commit 4162a51b273ba799a9d395dd70c45d96dba4e2ff -> > Author: Frank N. Stein -> > Commit: Vlad Dracula +> > Author: Frank N. Stein +> > Commit: Jane Smith > > -> > Update Vlad's bio. +> > Update Jane's bio. > > > > commit aaa3271e5e26f75f11892718e83a3e2743fab8ea -> > Author: Vlad Dracula -> > Commit: Vlad Dracula +> > Author: Jane Smith +> > Commit: Jane Smith > > -> > Vlad's initial bio. +> > Jane's initial bio. > > ~~~ > > {: .output} > {: .solution} diff --git a/_episodes/05-history.md b/_episodes/05-history.md index 332e8ee..3028bf3 100644 --- a/_episodes/05-history.md +++ b/_episodes/05-history.md @@ -20,41 +20,45 @@ As we saw in the previous lesson, we can refer to commits by their identifiers. You can refer to the _most recent commit_ of the working directory by using the identifier `HEAD`. -We've been adding one line at a time to `mars.txt`, so it's easy to track our +We've been adding one line at a time to `project.txt`, so it's easy to track our progress by looking, so let's do that using our `HEAD`s. Before we start, -let's make a change to `mars.txt`. +let's make a change to `project.txt`. ~~~ -$ nano mars.txt -$ cat mars.txt +$ nano project.txt +$ cat project.txt ~~~ {: .bash} ~~~ -Cold and dry, but everything is my favorite color -The two moons may be a problem for Wolfman -But the Mummy will appreciate the lack of humidity -An ill-considered change +Some initial data analysis to identify how inflammation changes over time after surgery. +Jane is a Data Scientist and Samit is a statistician. We'll need to determine +who is responsible for what in this project. +We may need to bring a third person with Python programming skills into the project. +The third team member needs to be competent in both Python and R. They +also need to be familiar with matplotlib and ggplot. +Version control skills would also be useful. ~~~ {: .output} Now, let's see what we get. ~~~ -$ git diff HEAD mars.txt +$ git diff HEAD project.txt ~~~ {: .bash} ~~~ -diff --git a/mars.txt b/mars.txt -index b36abfd..0848c8d 100644 ---- a/mars.txt -+++ b/mars.txt -@@ -1,3 +1,4 @@ - Cold and dry, but everything is my favorite color - The two moons may be a problem for Wolfman - But the Mummy will appreciate the lack of humidity -+An ill-considered change. +diff --git a/project.txt b/project.txt +index 6f77c9e..151f443 100644 +--- a/project.txt ++++ b/project.txt +@@ -4,3 +4,4 @@ who is responsible for what in this project. + We may need to bring a third person with Python programming skills into the project. + The third team member needs to be competent in both Python and R. They + also need to be familiar with matplotlib and ggplot ++Version control skills would also be useful. + ~~~ {: .output} @@ -63,7 +67,7 @@ real goodness in all this is when you can refer to previous commits. We do that by adding `~1` to refer to the commit one before `HEAD`. ~~~ -$ git diff HEAD~1 mars.txt +$ git diff HEAD~1 project.txt ~~~ {: .bash} @@ -72,44 +76,48 @@ again, but with the notation `HEAD~1`, `HEAD~2`, and so on, to refer to them: ~~~ -$ git diff HEAD~2 mars.txt +$ git diff HEAD~2 project.txt ~~~ {: .bash} ~~~ -diff --git a/mars.txt b/mars.txt -index df0654a..b36abfd 100644 ---- a/mars.txt -+++ b/mars.txt -@@ -1 +1,4 @@ - Cold and dry, but everything is my favorite color -+The two moons may be a problem for Wolfman -+But the Mummy will appreciate the lack of humidity -+An ill-considered change +diff --git a/project.txt b/project.txt +index 2485f1d..151f443 100644 +--- a/project.txt ++++ b/project.txt +@@ -1,3 +1,7 @@ + Some initial data analysis to identify how inflammation changes over time after surgery. + Jane is a Data Scientist and Samit is a statistician. We'll need to determine + who is responsible for what in this project. ++We may need to bring a third person with Python programming skills into the project. ++The third team member needs to be competent in both Python and R. They ++also need to be familiar with matplotlib and ggplot ++Version control skills would also be useful. ~~~ {: .output} We could also use `git show` which shows us what changes we made at an older commit as well as the commit message, rather than the _differences_ between a commit and our working directory that we see by using `git diff`. ~~~ -$ git show HEAD~2 mars.txt +$ git show HEAD~2 project.txt ~~~ {: .bash} ~~~ -commit 34961b159c27df3b475cfe4415d94a6d1fcd064d -Author: Vlad Dracula -Date: Thu Aug 22 10:07:21 2013 -0400 +commit 71ed26a8f840d2929f5120327ea0accd55074070 +Author: Jane Smith +Date: Wed Jan 3 10:39:19 2018 +0000 - Start notes on Mars as a base + Add note about project responsibilities -diff --git a/mars.txt b/mars.txt -new file mode 100644 -index 0000000..df0654a ---- /dev/null -+++ b/mars.txt -@@ -0,0 +1 @@ -+Cold and dry, but everything is my favorite color +diff --git a/project.txt b/project.txt +index 17e2b79..2485f1d 100644 +--- a/project.txt ++++ b/project.txt +@@ -1 +1,3 @@ + Some initial data analysis to identify how inflammation changes over time after surgery. ++Jane is a Data Scientist and Samit is a statistician. We'll need to determine ++who is responsible for what in this project. ~~~ {: .output} @@ -129,62 +137,68 @@ and "unique" really does mean unique: every change to any set of files on any computer has a unique 40-character identifier. Our first commit was given the ID -`f22b25e3233b4645dabd0d81e651fe074bd8e73b`, +`40b8a9400329ed7324116cc9392dc8e4842d8501`, so let's try this: ~~~ -$ git diff f22b25e3233b4645dabd0d81e651fe074bd8e73b mars.txt +$ git diff 40b8a9400329ed7324116cc9392dc8e4842d8501 project.txt ~~~ {: .bash} ~~~ -diff --git a/mars.txt b/mars.txt -index df0654a..93a3e13 100644 ---- a/mars.txt -+++ b/mars.txt -@@ -1 +1,4 @@ - Cold and dry, but everything is my favorite color -+The two moons may be a problem for Wolfman -+But the Mummy will appreciate the lack of humidity -+An ill-considered change +diff --git a/project.txt b/project.txt +index 17e2b79..151f443 100644 +--- a/project.txt ++++ b/project.txt +@@ -1 +1,7 @@ + Some initial data analysis to identify how inflammation changes over time after surgery. ++Jane is a Data Scientist and Samit is a statistician. We'll need to determine ++who is responsible for what in this project. ++We may need to bring a third person with Python programming skills into the project. ++The third team member needs to be competent in both Python and R. They ++also need to be familiar with matplotlib and ggplot ++Version control skills would also be useful. + ~~~ {: .output} -That's the right answer, -but typing out random 40-character strings is annoying, +That's the right answer; all the changes we made since the first commit. +Typing out random 40-character strings is annoying, so Git lets us use just the first few characters: ~~~ -$ git diff f22b25e mars.txt +$ git diff 40b8a9 project.txt ~~~ {: .bash} ~~~ -diff --git a/mars.txt b/mars.txt -index df0654a..93a3e13 100644 ---- a/mars.txt -+++ b/mars.txt -@@ -1 +1,4 @@ - Cold and dry, but everything is my favorite color -+The two moons may be a problem for Wolfman -+But the Mummy will appreciate the lack of humidity -+An ill-considered change +diff --git a/project.txt b/project.txt +index 17e2b79..151f443 100644 +--- a/project.txt ++++ b/project.txt +@@ -1 +1,7 @@ + Some initial data analysis to identify how inflammation changes over time after surgery. ++Jane is a Data Scientist and Samit is a statistician. We'll need to determine ++who is responsible for what in this project. ++We may need to bring a third person with Python programming skills into the project. ++The third team member needs to be competent in both Python and R. They ++also need to be familiar with matplotlib and ggplot ++Version control skills would also be useful. ~~~ {: .output} -All right! So -we can save changes to files and see what we've changed—now how +So we can now save changes to files and see what we've changed; how can we restore older versions of things? Let's suppose we accidentally overwrite our file: ~~~ -$ nano mars.txt -$ cat mars.txt +$ nano project.txt +$ cat project.txt ~~~ {: .bash} ~~~ -We will need to manufacture our own oxygen +We could use Github, Gitlab or Bitbucket to host our code. ~~~ {: .output} @@ -202,25 +216,28 @@ Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) - modified: mars.txt + modified: project.txt no changes added to commit (use "git add" and/or "git commit -a") -~~~ {: .output} We can put things back the way they were by using `git checkout`: ~~~ -$ git checkout HEAD mars.txt -$ cat mars.txt +$ git checkout HEAD project.txt +$ cat project.txt ~~~ {: .bash} ~~~ -Cold and dry, but everything is my favorite color -The two moons may be a problem for Wolfman -But the Mummy will appreciate the lack of humidity +Some initial data analysis to identify how inflammation changes over time after surgery. +Jane is a Data Scientist and Samit is a statistician. We'll need to determine +who is responsible for what in this project. +We may need to bring a third person with Python programming skills into the project. +The third team member needs to be competent in both Python and R. They +also need to be familiar with matplotlib and ggplot + ~~~ {: .output} @@ -233,12 +250,12 @@ If we want to go back even further, we can use a commit identifier instead: ~~~ -$ git checkout f22b25e mars.txt +$ git checkout 40b8a9 project.txt ~~~ {: .bash} ~~~ -$ cat mars.txt +$ cat project.txt ~~~ {: .bash} @@ -260,7 +277,7 @@ Changes to be committed: # (use "git add ..." to update what will be committed) # (use "git checkout -- ..." to discard changes in working directory) # -# modified: mars.txt +# modified: project.txt # no changes added to commit (use "git add" and/or "git commit -a") ~~~ @@ -271,7 +288,7 @@ Again, we can put things back the way they were by using `git checkout`: ~~~ -$ git checkout HEAD mars.txt +$ git checkout HEAD project.txt ~~~ {: .bash} @@ -280,12 +297,12 @@ $ git checkout HEAD mars.txt > Above we used > > ~~~ -> $ git checkout f22b25e mars.txt +> $ git checkout f22b25e project.txt > ~~~ > {: .bash} > -> to revert `mars.txt` to its state after the commit `f22b25e`. -> If you forget `mars.txt` in that command, Git will tell you that "You are in +> to revert `project.txt` to its state after the commit `f22b25e`. +> If you forget `project.txt` in that command, Git will tell you that "You are in > 'detached HEAD' state." In this state, you shouldn't make any changes. > You can fix this by reattaching your head using ``git checkout master`` {: .callout} @@ -378,16 +395,16 @@ moving backward and forward in time becomes much easier. > ## Understanding Workflow and History > -> What is the output of cat venus.txt at the end of this set of commands? +> What is the output of `cat analysis.txt` at the end of this set of commands? > > ~~~ -> $ cd planets -> $ nano venus.txt #input the following text: Venus is beautiful and full of love -> $ git add venus.txt -> $ nano venus.txt #add the following text: Venus is too hot to be suitable as a base -> $ git commit -m "Comment on Venus as an unsuitable base" -> $ git checkout HEAD venus.txt -> $ cat venus.txt #this will print the contents of venus.txt to the screen +> $ cd inflammation +> $ nano analysis.txt #input the following text: We need to think about the statistical techniques to apply +> $ git add analysis.txt +> $ nano analysis.txt #add the following text: So that we have defensible conclusions +> $ git commit -m "Thoughts on statistical techniques" +> $ git checkout HEAD analysis.txt +> $ cat analysis.txt #this will print the contents of analysis.txt to the screen > ~~~ > {: .bash} > @@ -470,10 +487,10 @@ moving backward and forward in time becomes much easier. > ## Checking Understanding of `git diff` > -> Consider this command: `git diff HEAD~3 mars.txt`. What do you predict this command +> Consider this command: `git diff HEAD~3 project.txt`. What do you predict this command > will do if you execute it? What happens when you do execute it? Why? > -> Try another command, `git diff [ID] mars.txt`, where [ID] is replaced with +> Try another command, `git diff [ID] project.txt`, where [ID] is replaced with > the unique identifier for your most recent commit. What do you think will happen, > and what does happen? {: .challenge} @@ -482,7 +499,7 @@ moving backward and forward in time becomes much easier. > > `git checkout` can be used to restore a previous commit when unstaged changes have > been made, but will it also work for changes that have been staged but not committed? -> Make a change to `mars.txt`, add that change, and use `git checkout` to see if +> Make a change to `project.txt`, add that change, and use `git checkout` to see if > you can remove your change. {: .challenge} @@ -492,15 +509,15 @@ moving backward and forward in time becomes much easier. > the right commit ID, especially if the commit is from several months ago. > > Imagine the `planets` project has more than 50 files. -> You would like to find a commit with specific text in `mars.txt` is modified. +> You would like to find a commit with specific text in `project.txt` is modified. > When you type `git log`, a very long list appeared, > How can you narrow down the search? > > Recall that the `git diff` command allow us to explore one specific file, -> e.g. `git diff mars.txt`. We can apply a similar idea here. +> e.g. `git diff project.txt`. We can apply a similar idea here. > > ~~~ -> $ git log mars.txt +> $ git log project.txt > ~~~ > {: .bash} > @@ -511,7 +528,7 @@ moving backward and forward in time becomes much easier. > Is it possible to combine both? Let's try the following: > > ~~~ -> $ git log --patch mars.txt +> $ git log --patch project.txt > ~~~ > {: .bash} > diff --git a/_episodes/06-ignore.md b/_episodes/06-ignore.md index 0f4a4d4..76b2810 100644 --- a/_episodes/06-ignore.md +++ b/_episodes/06-ignore.md @@ -14,7 +14,7 @@ keypoints: What if we have files that we do not want Git to track for us, like backup files created by our editor or intermediate files created during data analysis? -Let's create a few dummy files: +Let's create a few dummy files in the `inflammation` directory: ~~~ $ mkdir results @@ -199,10 +199,10 @@ nothing to commit, working directory clean > Given a directory structure that looks like: > > ~~~ -> results/data/position/gps/a.data -> results/data/position/gps/b.data -> results/data/position/gps/c.data -> results/data/position/gps/info.txt +> results/data/ward/patient/a.data +> results/data/ward/patient/b.data +> results/data/ward/patient/c.data +> results/data/ward/patient/info.txt > results/plots > ~~~ > {: .bash} @@ -212,8 +212,8 @@ nothing to commit, working directory clean > > > ## Solution > > -> > Appending `results/data/position/gps/*.data` will match every file in `results/data/position/gps` that ends with `.data`. -> > The file `results/data/position/gps/info.txt` will not be ignored. +> > Appending `results/data/ward/patients/*.data` will match every file in `results/data/position/gps` that ends with `.data`. +> > The file `results/data/ward/patient/info.txt` will not be ignored. > {: .solution} {: .challenge} diff --git a/_episodes/07-github.md b/_episodes/07-github.md index 8e93f55..6456bcd 100644 --- a/_episodes/07-github.md +++ b/_episodes/07-github.md @@ -14,24 +14,26 @@ keypoints: - "`git pull` copies changes from a remote repository to a local repository." --- -Version control really comes into its own when we begin to collaborate with +Version control really comes into its own when we use it to collaborate with other people. We already have most of the machinery we need to do this; the -only thing missing is to copy changes from one repository to another. +only thing missing is the ability to copy changes from one repository to another. Systems like Git allow us to move work between any two repositories. In -practice, though, it's easiest to use one copy as a central hub, and to keep it -on the web rather than on someone's laptop. Most programmers use hosting +practice, though, it's easiest to use one copy as a central hub, and to keep that copy +on the web rather than on someone's laptop. + +Most programmers use hosting services like [GitHub](https://github.com), [BitBucket](https://bitbucket.org) or [GitLab](https://gitlab.com/) to hold those master copies; we'll explore the pros and cons of this in the final section of this lesson. Let's start by sharing the changes we've made to our current project with the world. Log in to GitHub, then click on the icon in the top right corner to -create a new repository called `planets`: +create a new repository called `inflammation`: ![Creating a Repository on GitHub (Step 1)](../fig/github-create-repo-01.png) -Name your repository "planets" and then click "Create Repository": +Name your repository "inflamation" and then click "Create Repository": ![Creating a Repository on GitHub (Step 2)](../fig/github-create-repo-02.png) @@ -43,16 +45,16 @@ information on how to configure your local repository: This effectively does the following on GitHub's servers: ~~~ -$ mkdir planets -$ cd planets +$ mkdir inflammation +$ cd inflammation $ git init ~~~ {: .bash} -Our local repository still contains our earlier work on `mars.txt`, but the +Our local repository still contains our earlier work on the text files, but the remote repository on GitHub doesn't contain any files yet: -![Freshly-Made GitHub Repository](../fig/git-freshly-made-github-repo.svg) +![Freshly-Made GitHub Repository](../fig/git-freshly-made-github-repo.png) The next step is to connect the two repositories. We do this by making the GitHub repository a [remote]({{ page.root }}/reference/#remote) for the local repository. @@ -77,16 +79,15 @@ SSH to HTTPS. ![Changing the Repository URL on GitHub](../fig/github-change-repo-string.png) -Copy that URL from the browser, go into the local `planets` repository, and run +Copy that URL from the browser, go into the local `inflammation` repository, and run this command: ~~~ -$ git remote add origin https://github.com/vlad/planets.git +$ git remote add origin https://github.com/jane/inflammation.git ~~~ {: .bash} -Make sure to use the URL for your repository rather than Vlad's: the only -difference should be your username instead of `vlad`. +Make sure to use the URL for your repository rather than Jane's. We can check that the command has worked by running `git remote -v`: @@ -96,8 +97,8 @@ $ git remote -v {: .bash} ~~~ -origin https://github.com/vlad/planets.git (push) -origin https://github.com/vlad/planets.git (fetch) +origin https://github.com/ARCTraining/inflammation.git (fetch) +origin https://github.com/ARCTraining/inflammation.git (push) ~~~ {: .output} @@ -113,14 +114,14 @@ $ git push origin master {: .bash} ~~~ -Counting objects: 9, done. +Counting objects: 16, done. Delta compression using up to 4 threads. -Compressing objects: 100% (6/6), done. -Writing objects: 100% (9/9), 821 bytes, done. -Total 9 (delta 2), reused 0 (delta 0) -To https://github.com/vlad/planets +Compressing objects: 100% (13/13), done. +Writing objects: 100% (16/16), 1.62 KiB | 1.62 MiB/s, done. +Total 16 (delta 4), reused 0 (delta 0) +remote: Resolving deltas: 100% (4/4), done. +To https://github.com/ARCTraining/inflammation.git * [new branch] master -> master -Branch master set up to track remote branch master from origin. ~~~ {: .output} @@ -190,9 +191,10 @@ $ git pull origin master {: .bash} ~~~ -From https://github.com/vlad/planets +From https://github.com/ARCTraining/inflammation * branch master -> FETCH_HEAD Already up-to-date. + ~~~ {: .output} @@ -202,7 +204,7 @@ GitHub, though, this command would download them to our local repository. > ## GitHub GUI > -> Browse to your `planets` repository on GitHub. +> Browse to your `inflammation` repository on GitHub. > Under the Code tab, find and click on the text that says "XX commits" (where "XX" is some number). > Hover over, and click on, the three buttons to the right of each commit. > What information can you gather/explore from these buttons? diff --git a/_episodes/08-collab.md b/_episodes/08-collab.md index aeafc67..25d58f9 100644 --- a/_episodes/08-collab.md +++ b/_episodes/08-collab.md @@ -39,11 +39,11 @@ Next, the Collaborator needs to download a copy of the Owner's repository to her her `Desktop` folder, the Collaborator enters: ~~~ -$ git clone https://github.com/vlad/planets.git ~/Desktop/vlad-planets +$ git clone https://github.com/jane/inflammation.git ~/Desktop/jane-inflammation ~~~ {: .bash} -Replace 'vlad' with the Owner's username. +Replace `jane` with the correct username for your collaborator. ![After Creating Clone of Repository](../fig/github-collaboration.svg) @@ -51,26 +51,27 @@ The Collaborator can now make a change in her clone of the Owner's repository, exactly the same way as we've been doing before: ~~~ -$ cd ~/Desktop/vlad-planets -$ nano pluto.txt -$ cat pluto.txt +$ cd ~/Desktop/jane-inflammation +$ nano code.py +$ cat code.py ~~~ {: .bash} ~~~ -It is so a planet! +# This will be a Python script ~~~ {: .output} ~~~ -$ git add pluto.txt -$ git commit -m "Add notes about Pluto" +$ git add code.py +$ git commit -m "First Python analysis script" ~~~ {: .bash} ~~~ - 1 file changed, 1 insertion(+) - create mode 100644 pluto.txt +[master 6cc98ec] First Python analysis script +1 file changed, 2 insertions(+) +create mode 100644 code.py ~~~ {: .output} @@ -82,13 +83,13 @@ $ git push origin master {: .bash} ~~~ -Counting objects: 4, done. +Counting objects: 3, done. Delta compression using up to 4 threads. Compressing objects: 100% (2/2), done. -Writing objects: 100% (3/3), 306 bytes, done. +Writing objects: 100% (3/3), 354 bytes | 354.00 KiB/s, done. Total 3 (delta 0), reused 0 (delta 0) -To https://github.com/vlad/planets.git - 9272da5..29aba7c master -> master +To https://github.com/jane/inflammation.git + 9dba5e1..6cc98ec master -> master ~~~ {: .output} @@ -108,17 +109,18 @@ $ git pull origin master {: .bash} ~~~ -remote: Counting objects: 4, done. +rremote: Counting objects: 3, done. remote: Compressing objects: 100% (2/2), done. -remote: Total 3 (delta 0), reused 3 (delta 0) +remote: Total 3 (delta 0), reused 3 (delta 0), pack-reused 0 Unpacking objects: 100% (3/3), done. -From https://github.com/vlad/planets +From https://github.com/ARCTraining/inflammation * branch master -> FETCH_HEAD -Updating 9272da5..29aba7c + 9dba5e1..6cc98ec master -> origin/master +Updating 9dba5e1..6cc98ec Fast-forward - pluto.txt | 1 + - 1 file changed, 1 insertion(+) - create mode 100644 pluto.txt + code.py | 2 ++ + 1 file changed, 2 insertions(+) + create mode 100644 code.py ~~~ {: .output} diff --git a/_episodes/09-conflict.md b/_episodes/09-conflict.md index 32e9120..5153a14 100644 --- a/_episodes/09-conflict.md +++ b/_episodes/09-conflict.md @@ -20,47 +20,54 @@ different changes to each copy. Version control helps us manage these [resolve]({{ page.root }}/reference/#resolve) overlapping changes. To see how we can resolve conflicts, we must first create one. The file -`mars.txt` currently looks like this in both partners' copies of our `planets` +`project.txt` currently looks like this in both partners' copies of our `inflammation` repository: ~~~ -$ cat mars.txt +$ cat project.txt ~~~ {: .bash} ~~~ -Cold and dry, but everything is my favorite color -The two moons may be a problem for Wolfman -But the Mummy will appreciate the lack of humidity +Some initial data analysis to identify how inflammation changes over time after surgery. +Jane is a Data Scientist and Samit is a statistician. We'll need to determine +who is responsible for what in this project. +We may need to bring a third person with Python programming skills into the project. +The third team member needs to be competent in both Python and R. They +also need to be familiar with matplotlib and ggplot + ~~~ {: .output} Let's add a line to one partner's copy only: ~~~ -$ nano mars.txt -$ cat mars.txt +$ nano project.txt +$ cat project.txt ~~~ {: .bash} ~~~ -Cold and dry, but everything is my favorite color -The two moons may be a problem for Wolfman -But the Mummy will appreciate the lack of humidity -This line added to Wolfman's copy +Some initial data analysis to identify how inflammation changes over time after surgery. +Jane is a Data Scientist and Samit is a statistician. We'll need to determine +who is responsible for what in this project. +We may need to bring a third person with Python programming skills into the project. +The third team member needs to be competent in both Python and R. They +also need to be familiar with matplotlib and ggplot +This line added to the collaborator's copy ~~~ {: .output} and then push the change to GitHub: ~~~ -$ git add mars.txt -$ git commit -m "Add a line in our home copy" +$ git add project.txt +$ git commit -m "Add a line to the collaborator copy" ~~~ {: .bash} ~~~ -[master 5ae9631] Add a line in our home copy +[master f4915d6] Add a line to the collaborator copy 1 file changed, 1 insertion(+) ~~~ {: .output} @@ -71,44 +78,48 @@ $ git push origin master {: .bash} ~~~ -Counting objects: 5, done. +Counting objects: 3, done. Delta compression using up to 4 threads. Compressing objects: 100% (3/3), done. -Writing objects: 100% (3/3), 352 bytes, done. -Total 3 (delta 1), reused 0 (delta 0) -To https://github.com/vlad/planets - 29aba7c..dabb4c8 master -> master +Writing objects: 100% (3/3), 333 bytes | 333.00 KiB/s, done. +Total 3 (delta 2), reused 0 (delta 0) +remote: Resolving deltas: 100% (2/2), completed with 2 local objects. +To https://github.com/ARCTraining/inflammation.git + 6cc98ec..f4915d6 master -> master ~~~ {: .output} -Now let's have the other partner +Now let's have the other partner (the originator) make a different change to their copy *without* updating from GitHub: ~~~ -$ nano mars.txt -$ cat mars.txt +$ nano project.txt +$ cat project.txt ~~~ {: .bash} ~~~ -Cold and dry, but everything is my favorite color -The two moons may be a problem for Wolfman -But the Mummy will appreciate the lack of humidity -We added a different line in the other copy +Some initial data analysis to identify how inflammation changes over time after surgery. +Jane is a Data Scientist and Samit is a statistician. We'll need to determine +who is responsible for what in this project. +We may need to bring a third person with Python programming skills into the project. +The third team member needs to be competent in both Python and R. They +also need to be familiar with matplotlib and ggplot +Add a different line to the originator's copy ~~~ {: .output} We can commit the change locally: ~~~ -$ git add mars.txt -$ git commit -m "Add a line in my copy" +$ git add project.txt +$ git commit -m "Add a line in the originator's copy" ~~~ {: .bash} ~~~ -[master 07ebc69] Add a line in my copy +[master ef10d89] Add a line in the originator's copy 1 file changed, 1 insertion(+) ~~~ {: .output} @@ -121,17 +132,18 @@ $ git push origin master {: .bash} ~~~ -To https://github.com/vlad/planets.git - ! [rejected] master -> master (non-fast-forward) -error: failed to push some refs to 'https://github.com/vlad/planets.git' -hint: Updates were rejected because the tip of your current branch is behind -hint: its remote counterpart. Merge the remote changes (e.g. 'git pull') -hint: before pushing again. +To https://github.com/jane/inflammation.git + ! [rejected] master -> master (fetch first) +error: failed to push some refs to 'https://github.com/jane/inflammation.git' +hint: Updates were rejected because the remote contains work that you do +hint: not have locally. This is usually caused by another repository pushing +hint: to the same ref. You may want to first integrate the remote changes +hint: (e.g., 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. ~~~ {: .output} -![The Conflicting Changes](../fig/conflict.svg) +![The Conflicting Changes](../fig/conflict.png) Git detects that the changes made in one copy overlap with those made in the other and stops us from trampling on our previous work. @@ -146,14 +158,15 @@ $ git pull origin master {: .bash} ~~~ -remote: Counting objects: 5, done. -remote: Compressing objects: 100% (2/2), done. -remote: Total 3 (delta 1), reused 3 (delta 1) +remote: Counting objects: 3, done. +remote: Compressing objects: 100% (1/1), done. +remote: Total 3 (delta 2), reused 3 (delta 2), pack-reused 0 Unpacking objects: 100% (3/3), done. -From https://github.com/vlad/planets +From https://github.com/jane/inflammation * branch master -> FETCH_HEAD -Auto-merging mars.txt -CONFLICT (content): Merge conflict in mars.txt + 6cc98ec..f4915d6 master -> origin/master +Auto-merging project.txt +CONFLICT (content): Merge conflict in project.txt Automatic merge failed; fix conflicts and then commit the result. ~~~ {: .output} @@ -162,19 +175,22 @@ Automatic merge failed; fix conflicts and then commit the result. and marks that conflict in the affected file: ~~~ -$ cat mars.txt +$ cat project.txt ~~~ {: .bash} ~~~ -Cold and dry, but everything is my favorite color -The two moons may be a problem for Wolfman -But the Mummy will appreciate the lack of humidity +Some initial data analysis to identify how inflammation changes over time after surgery. +Jane is a Data Scientist and Samit is a statistician. We'll need to determine +who is responsible for what in this project. +We may need to bring a third person with Python programming skills into the project. +The third team member needs to be competent in both Python and R. They +also need to be familiar with matplotlib and ggplot <<<<<<< HEAD -We added a different line in the other copy +Add a different line to the originator's copy ======= -This line added to Wolfman's copy ->>>>>>> dabb4c8c450e8475aee9b14b4383acc99f42af1d +This line added to the collaborator's copy +>>>>>>> f4915d64b522b8f4599fa89b7d194e615462f99f ~~~ {: .output} @@ -192,7 +208,7 @@ or get rid of the change entirely. Let's replace both so that the file looks like this: ~~~ -$ cat mars.txt +$ cat project.txt ~~~ {: .bash} @@ -205,11 +221,11 @@ We removed the conflict on this line {: .output} To finish merging, -we add `mars.txt` to the changes being made by the merge +we add `project.txt` to the changes being made by the merge and then commit: ~~~ -$ git add mars.txt +$ git add project.txt $ git status ~~~ {: .bash} @@ -221,7 +237,7 @@ All conflicts fixed but you are still merging. Changes to be committed: - modified: mars.txt + modified: project.txt ~~~ {: .output} @@ -244,13 +260,14 @@ $ git push origin master {: .bash} ~~~ -Counting objects: 10, done. +Counting objects: 7, done. Delta compression using up to 4 threads. -Compressing objects: 100% (6/6), done. -Writing objects: 100% (6/6), 697 bytes, done. -Total 6 (delta 2), reused 0 (delta 0) -To https://github.com/vlad/planets.git - dabb4c8..2abf2b1 master -> master +Compressing objects: 100% (7/7), done. +Writing objects: 100% (7/7), 755 bytes | 755.00 KiB/s, done. +Total 7 (delta 4), reused 0 (delta 0) +remote: Resolving deltas: 100% (4/4), completed with 3 local objects. +To https://github.com/jane/inflammation.git + f4915d6..dc29981 master -> master ~~~ {: .output} @@ -264,35 +281,40 @@ $ git pull origin master {: .bash} ~~~ -remote: Counting objects: 10, done. -remote: Compressing objects: 100% (4/4), done. -remote: Total 6 (delta 2), reused 6 (delta 2) -Unpacking objects: 100% (6/6), done. -From https://github.com/vlad/planets +rremote: Counting objects: 7, done. +remote: Compressing objects: 100% (3/3), done. +remote: Total 7 (delta 4), reused 7 (delta 4), pack-reused 0 +Unpacking objects: 100% (7/7), done. +From https://github.com/jane/inflammation * branch master -> FETCH_HEAD -Updating dabb4c8..2abf2b1 + f4915d6..dc29981 master -> origin/master +Updating f4915d6..dc29981 Fast-forward - mars.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + analysis.txt | 1 + + 1 files changed, 1 insertions(+) ~~~ {: .output} We get the merged file: ~~~ -$ cat mars.txt +$ cat project.txt ~~~ {: .bash} ~~~ -Cold and dry, but everything is my favorite color -The two moons may be a problem for Wolfman -But the Mummy will appreciate the lack of humidity -We removed the conflict on this line +Some initial data analysis to identify how inflammation changes over time after surgery. +Jane is a Data Scientist and Samit is a statistician. We'll need to determine +who is responsible for what in this project. +We may need to bring a third person with Python programming skills into the project. +The third team member needs to be competent in both Python and R. They +also need to be familiar with matplotlib and ggplot +Add a different line to the originator's copy +This line added to the collaborator's copy ~~~ {: .output} -We don't need to merge again because Git knows someone has already done that. +We **don't** need to merge again because Git knows someone has already done that. Git's ability to resolve conflicts is very useful, but conflict resolution costs time and effort, and can introduce errors if conflicts are not resolved @@ -332,15 +354,19 @@ Conflicts can also be minimized with project management strategies: > > > ## Solution > > -> > Let's try it. Suppose Dracula takes a picture of Martian surface and -> > calls it `mars.jpg`. +> > Let's try it. Suppose Jane saves an image of a chart she creates and +> > calls it `chart1.jpg`. > > -> > If you do not have an image file of Mars available, you can create +> > If you do not have an image file of a chart somewhere, you can create > > a dummy binary file like this: > > > > ~~~ -> > $ head --bytes 1024 /dev/urandom > mars.jpg -> > $ ls -lh mars.jpg +> > $ head --bytes 1024 /dev/urandom > chart1.jpg +> > $ ls -lh chart1.jpg +> > +> > or on a Mac: +> > $ head -c 1024 /dev/urandom > chart1.jpg +> > $ ls -lh chart1.jpg > > ~~~ > > {: .bash} > > @@ -352,24 +378,26 @@ Conflicts can also be minimized with project management strategies: > > `ls` shows us that this created a 1-kilobyte file. It is full of > > random bytes read from the special file, `/dev/urandom`. > > -> > Now, suppose Dracula adds `mars.jpg` to his repository: +> > Now, suppose Jane adds `chart1.jpg` to her repository: > > > > ~~~ -> > $ git add mars.jpg -> > $ git commit -m "Add picture of Martian surface" +> > $ git add chart1.jpg +> > $ git commit -m "Add a chart image" > > ~~~ > > {: .bash} > > > > ~~~ -> > [master 8e4115c] Add picture of Martian surface -> > 1 file changed, 0 insertions(+), 0 deletions(-) -> > create mode 100644 mars.jpg +> > [master c769bc5] Add a chart image +> > 1 file changed, 0 insertions(+), 0 deletions(-) +> > create mode 100644 chart1.jpg > > ~~~ > > {: .output} > > -> > Suppose that Wolfman has added a similar picture in the meantime. -> > His is a picture of the Martian sky, but it is *also* called `mars.jpg`. -> > When Dracula tries to push, he gets a familiar message: +> > Suppose that Jane's collaborator has added a similar picture in the meantime +> > and pushed it up to the Github repository. +> > +> > His is a picture of another chart, but it is *also* called `chart1.jpg`. +> > When Jane tries to push, she gets a familiar message: > > > > ~~~ > > $ git push origin master @@ -377,14 +405,14 @@ Conflicts can also be minimized with project management strategies: > > {: .bash} > > > > ~~~ -> > To https://github.com/vlad/planets.git -> > ! [rejected] master -> master (fetch first) -> > error: failed to push some refs to 'https://github.com/vlad/planets.git' -> > hint: Updates were rejected because the remote contains work that you do -> > hint: not have locally. This is usually caused by another repository pushing -> > hint: to the same ref. You may want to first integrate the remote changes -> > hint: (e.g., 'git pull ...') before pushing again. -> > hint: See the 'Note about fast-forwards' in 'git push --help' for details. +To https://github.com/jane/inflammation.git + ! [rejected] master -> master (fetch first) +error: failed to push some refs to 'https://github.com/jane/inflammation.git' +hint: Updates were rejected because the remote contains work that you do +hint: not have locally. This is usually caused by another repository pushing +hint: to the same ref. You may want to first integrate the remote changes +hint: (e.g., 'git pull ...') before pushing again. +hint: See the 'Note about fast-forwards' in 'git push --help' for details. > > ~~~ > > {: .output} > > @@ -402,23 +430,23 @@ Conflicts can also be minimized with project management strategies: > > $ git pull origin master > > remote: Counting objects: 3, done. > > remote: Compressing objects: 100% (3/3), done. -> > remote: Total 3 (delta 0), reused 0 (delta 0) +> > remote: Total 3 (delta 0), reused 3 (delta 0), pack-reused 0 > > Unpacking objects: 100% (3/3), done. -> > From https://github.com/vlad/planets.git +> > From https://github.com/ARCTraining/inflammation > > * branch master -> FETCH_HEAD -> > 6a67967..439dc8c master -> origin/master -> > warning: Cannot merge binary files: mars.jpg (HEAD vs. 439dc8c08869c342438f6dc4a2b615b05b93c76e) -> > Auto-merging mars.jpg -> > CONFLICT (add/add): Merge conflict in mars.jpg +> > dc29981..c769bc5 master -> origin/master +> > warning: Cannot merge binary files: chart1.jpg (HEAD vs. c769bc59aa612198cf77ac01a9e8f8479d7940ea) +> > Auto-merging chart1.jpg +> > CONFLICT (add/add): Merge conflict in chart1.jpg > > Automatic merge failed; fix conflicts and then commit the result. > > ~~~ > > {: .output} > > -> > The conflict message here is mostly the same as it was for `mars.txt`, but +> > The conflict message here is mostly the same as it was for `project.txt`, but > > there is one key additional line: > > > > ~~~ -> > warning: Cannot merge binary files: mars.jpg (HEAD vs. 439dc8c08869c342438f6dc4a2b615b05b93c76e) +> > warning: Cannot merge binary files: chart1.jpg (HEAD vs. c769bc59aa612198cf77ac01a9e8f8479d7940ea) > > ~~~ > > > > Git cannot automatically insert conflict markers into an image as it does @@ -426,34 +454,34 @@ Conflicts can also be minimized with project management strategies: > > the version we want to keep. Then we can add and commit this version. > > > > On the key line above, Git has conveniently given us commit identifiers -> > for the two versions of `mars.jpg`. Our version is `HEAD`, and Wolfman's -> > version is `439dc8c0...`. If we want to use our version, we can use +> > for the two versions of `chart1.jpg`. Our version is `HEAD`, and the collaborator's +> > version is `c769bc5...`. If we want to use our version, we can use > > `git checkout`: > > > > ~~~ -> > $ git checkout HEAD mars.jpg -> > $ git add mars.jpg -> > $ git commit -m "Use image of surface instead of sky" +> > $ git checkout HEAD chart1.jpg +> > $ git add chart1.jpg +> > $ git commit -m "Use the greyscale image instead of the colour one" > > ~~~ > > {: .bash} > > > > ~~~ -> > [master 21032c3] Use image of surface instead of sky +> > [master 860c242] Use the greyscale image instead of the colour one > > ~~~ > > {: .output} > > -> > If instead we want to use Wolfman's version, we can use `git checkout` with -> > Wolfman's commit identifier, `439dc8c0`: +> > If instead we want to use our collaborator's version, we can use `git checkout` with +> > their commit identifier, `c769bc5`: > > > > ~~~ -> > $ git checkout 439dc8c0 mars.jpg -> > $ git add mars.jpg -> > $ git commit -m "Use image of sky instead of surface" +> > $ git checkout c769bc5 chart1.jpg +> > $ git add chart1.jpg +> > $ git commit -m "Use the colour image instead of the greyscale one" > > ~~~ > > {: .bash} > > > > ~~~ -> > [master da21b34] Use image of sky instead of surface +> > [master da21b34] Use the colour image instead of the greyscale one > > ~~~ > > {: .output} > > @@ -463,32 +491,32 @@ Conflicts can also be minimized with project management strategies: > > image and rename it: > > > > ~~~ -> > $ git checkout HEAD mars.jpg -> > $ git mv mars.jpg mars-surface.jpg -> > $ git checkout 439dc8c0 mars.jpg -> > $ mv mars.jpg mars-sky.jpg +> > $ git checkout HEAD chart1.jpg +> > $ git mv chart1.jpg chart1-grey.jpg +> > $ git checkout c769bc5 chart1.jpg +> > $ git mv chart1.jpg chart1-colour.jpg > > ~~~ > > {: .bash} > > -> > Then, remove the old `mars.jpg` and add the two new files: +> > Then, remove the old `chart1.jpg` (it it is still there) and add the two new files: > > > > ~~~ -> > $ git rm mars.jpg -> > $ git add mars-surface.jpg -> > $ git add mars-sky.jpg -> > $ git commit -m "Use two images: surface and sky" +> > $ git rm chart1.jpg +> > $ git add chart1-colour.jpg +> > $ git add chart1-grey.jpg +> > $ git commit -m "Use two images: grey and colour" > > ~~~ > > {: .bash} > > > > ~~~ -> > [master 94ae08c] Use two images: surface and sky -> > 2 files changed, 0 insertions(+), 0 deletions(-) -> > create mode 100644 mars-sky.jpg -> > rename mars.jpg => mars-surface.jpg (100%) +> >[master 6aa1183] Use two images: grey and colour +> > 2 files changed, 0 insertions(+), 0 deletions(-) +> > create mode 100644 chart1-colour.jpg +> > rename chart1.jpg => chart1-grey.jpg (100%) > > ~~~ > > {: .output} > > -> > Now both images of Mars are checked into the repository, and `mars.jpg` +> > Now both images are checked into the repository, and `chart1.jpg` > > no longer exists. > {: .solution} {: .challenge} diff --git a/_episodes/10-open.md b/_episodes/10-open.md index 016cf4b..8e9a050 100644 --- a/_episodes/10-open.md +++ b/_episodes/10-open.md @@ -96,14 +96,14 @@ by acting as a shareable electronic lab notebook for computational work: > ## Making Code Citable > -> Anything that is hosted in a version control repository (data, code, papers, +> Anything that is hosted in a version control repository (data, code, papers, > etc.) can be turned into a citable object. You'll learn how to do this in > [lesson 12: Citation]({{ page.root }}/12-citation/). {: .callout} > ## How Reproducible Is My Work? > -> Ask one of your labmates to reproduce a result you recently obtained +> Ask one of your colleagues to reproduce a result you recently obtained > using only what they can find in your papers or on the web. > Try to do the same for one of their results, > then try to do it for a result from a lab you work with. diff --git a/_episodes/11-licensing.md b/_episodes/11-licensing.md index 4d09896..a1f557d 100644 --- a/_episodes/11-licensing.md +++ b/_episodes/11-licensing.md @@ -56,6 +56,11 @@ decision only makes it more complicated later, because each time a new collaborator starts contributing, they, too, hold copyright and will thus need to be asked for approval once a license is chosen. +At the time of writing, the University does not issue clear guidance on **what** +are suitable licences. + +Before attaching a licence to your work, speak with your supervisor. + > ## Can I Use Open License? > > Find out whether you are allowed to apply an open license to your software. diff --git a/_episodes/12-citation.md b/_episodes/12-citation.md index 4a340f8..64d95d1 100644 --- a/_episodes/12-citation.md +++ b/_episodes/12-citation.md @@ -48,11 +48,10 @@ July 2013. More detailed advice, and other ways to make your code citable can be found in [here](https://www.software.ac.uk/how-cite-and-describe-software) and in: -> Smith AM, Katz DS, Niemeyer KE, FORCE11 Software Citation Working Group. +> Smith AM, Katz DS, Niemeyer KE, FORCE11 Software Citation Working Group. > (2016) Software citation principles. [PeerJ Computer Science 2:e86](https://peerj.com/articles/cs-86/) https://doi.org/10.7717/peerj-cs.86 - -There is also an [`@software{…`](https://www.google.de/search?q=git+citation+%22%40software%7B%22) + +There is also an [`@software{…`](https://www.google.de/search?q=git+citation+%22%40software%7B%22) [BibTeX](https://www.ctan.org/pkg/bibtex) entry type in case no "umbrella" citation like a paper or book exists for the project you want to make citable. - diff --git a/_episodes/13-hosting.md b/_episodes/13-hosting.md index fe2f0b5..c6f9e5f 100644 --- a/_episodes/13-hosting.md +++ b/_episodes/13-hosting.md @@ -12,9 +12,10 @@ keypoints: --- The second big question for groups that want to open up their work is where to -host their code and data. One option is for the lab, the department, or the -university to provide a server, manage accounts and backups, and so on. The -main benefit of this is that it clarifies who owns what, which is particularly +host their code and data. One option is for the lab, the school or department, or the +university to provide a server, manage accounts and backups, and so on. + +The main benefit of this is that it clarifies who owns what, which is particularly important if any of the material is sensitive (i.e., relates to experiments involving human subjects or may be used in a patent application). The main drawbacks are the cost of providing the service and its longevity: a scientist @@ -22,6 +23,9 @@ who has spent ten years collecting data would like to be sure that data will still be available ten years from now, but that's well beyond the lifespan of most of the grants that fund academic infrastructure. +At Leeds there is a simple remote repository service called [Leeds Develop](https://develop.leeds.ac.uk/) +Please contact `develop-service-users@lists.leeds.ac.uk` if you wish to use the service. + Another option is to purchase a domain and pay an Internet service provider (ISP) to host it. This gives the individual or group more control, and sidesteps problems that can arise when moving from one institution to another, diff --git a/_episodes/14-supplemental-rstudio.md b/_episodes/14-supplemental-rstudio.md index 34b5264..99c4c6e 100644 --- a/_episodes/14-supplemental-rstudio.md +++ b/_episodes/14-supplemental-rstudio.md @@ -15,7 +15,7 @@ integration with Git. There are some more obscure Git features that you still need to use the command-line for, but RStudio has a nice interface for most common operations. -RStudio let's you create a [project][rstudio-projects] associated with +RStudio let's you create a [project][https://support.rstudio.com/hc/en-us/articles/200526207-Using-Projects] associated with a given directory. This is a way to keep track of related files. One of the way to keep track of them is via version control! To get started using RStudio for version control, let's make a new project: @@ -55,7 +55,7 @@ to use Git: ![](../fig/RStudio_screenshot_afterclone.png) To edit the files in your repository, you can click on them from the panel in -the lower right. Let's add some more information about Pluto: +the lower right. Let's add some more to our `code.py` script: ![](../fig/RStudio_screenshot_editfiles.png) diff --git a/fig/RStudio_screenshot_afterclone.png b/fig/RStudio_screenshot_afterclone.png index 268c188..e31f093 100644 Binary files a/fig/RStudio_screenshot_afterclone.png and b/fig/RStudio_screenshot_afterclone.png differ diff --git a/fig/RStudio_screenshot_commit.png b/fig/RStudio_screenshot_commit.png index 66aeeab..41e2d93 100644 Binary files a/fig/RStudio_screenshot_commit.png and b/fig/RStudio_screenshot_commit.png differ diff --git a/fig/RStudio_screenshot_editfiles.png b/fig/RStudio_screenshot_editfiles.png index 251aed4..4805547 100644 Binary files a/fig/RStudio_screenshot_editfiles.png and b/fig/RStudio_screenshot_editfiles.png differ diff --git a/fig/RStudio_screenshot_existingdirectory.png b/fig/RStudio_screenshot_existingdirectory.png index 27658ee..cd75dfa 100644 Binary files a/fig/RStudio_screenshot_existingdirectory.png and b/fig/RStudio_screenshot_existingdirectory.png differ diff --git a/fig/RStudio_screenshot_gitignore.png b/fig/RStudio_screenshot_gitignore.png index 225e101..8a29563 100644 Binary files a/fig/RStudio_screenshot_gitignore.png and b/fig/RStudio_screenshot_gitignore.png differ diff --git a/fig/RStudio_screenshot_history.png b/fig/RStudio_screenshot_history.png index 5260074..28c4ec5 100644 Binary files a/fig/RStudio_screenshot_history.png and b/fig/RStudio_screenshot_history.png differ diff --git a/fig/RStudio_screenshot_navigateexisting.png b/fig/RStudio_screenshot_navigateexisting.png index ef8fcf8..bfb6a0b 100644 Binary files a/fig/RStudio_screenshot_navigateexisting.png and b/fig/RStudio_screenshot_navigateexisting.png differ diff --git a/fig/RStudio_screenshot_newproject.png b/fig/RStudio_screenshot_newproject.png index a4f7f79..fd0f6f4 100644 Binary files a/fig/RStudio_screenshot_newproject.png and b/fig/RStudio_screenshot_newproject.png differ diff --git a/fig/RStudio_screenshot_review.png b/fig/RStudio_screenshot_review.png index 3854b86..deb6d5d 100644 Binary files a/fig/RStudio_screenshot_review.png and b/fig/RStudio_screenshot_review.png differ diff --git a/fig/RStudio_screenshot_viewhistory.png b/fig/RStudio_screenshot_viewhistory.png index 4917409..ff2edb7 100644 Binary files a/fig/RStudio_screenshot_viewhistory.png and b/fig/RStudio_screenshot_viewhistory.png differ diff --git a/fig/conflict.png b/fig/conflict.png new file mode 100644 index 0000000..17c2389 Binary files /dev/null and b/fig/conflict.png differ diff --git a/fig/git-checkout.png b/fig/git-checkout.png new file mode 100644 index 0000000..821c34e Binary files /dev/null and b/fig/git-checkout.png differ diff --git a/fig/git-committing.png b/fig/git-committing.png new file mode 100644 index 0000000..2703ca2 Binary files /dev/null and b/fig/git-committing.png differ diff --git a/fig/git-freshly-made-github-repo.png b/fig/git-freshly-made-github-repo.png new file mode 100644 index 0000000..29c7906 Binary files /dev/null and b/fig/git-freshly-made-github-repo.png differ diff --git a/fig/git-staging-area.png b/fig/git-staging-area.png new file mode 100644 index 0000000..9e0b813 Binary files /dev/null and b/fig/git-staging-area.png differ diff --git a/fig/git_staging.png b/fig/git_staging.png new file mode 100644 index 0000000..281de06 Binary files /dev/null and b/fig/git_staging.png differ diff --git a/fig/github-add-collaborators.png b/fig/github-add-collaborators.png index 96922cc..9f485a0 100644 Binary files a/fig/github-add-collaborators.png and b/fig/github-add-collaborators.png differ diff --git a/fig/github-change-repo-string.png b/fig/github-change-repo-string.png index 2972099..cd095c0 100644 Binary files a/fig/github-change-repo-string.png and b/fig/github-change-repo-string.png differ diff --git a/fig/github-collaboration.png b/fig/github-collaboration.png new file mode 100644 index 0000000..65a9fdc Binary files /dev/null and b/fig/github-collaboration.png differ diff --git a/fig/github-create-repo-01.png b/fig/github-create-repo-01.png index 6dc6bf2..9b7b1a2 100644 Binary files a/fig/github-create-repo-01.png and b/fig/github-create-repo-01.png differ diff --git a/fig/github-create-repo-02.png b/fig/github-create-repo-02.png index d0c006f..72e1300 100644 Binary files a/fig/github-create-repo-02.png and b/fig/github-create-repo-02.png differ diff --git a/fig/github-create-repo-03.png b/fig/github-create-repo-03.png index ea56feb..31bfde6 100644 Binary files a/fig/github-create-repo-03.png and b/fig/github-create-repo-03.png differ diff --git a/fig/github-find-repo-string.png b/fig/github-find-repo-string.png index 0027659..cd095c0 100644 Binary files a/fig/github-find-repo-string.png and b/fig/github-find-repo-string.png differ diff --git a/fig/github-repo-after-first-push.png b/fig/github-repo-after-first-push.png new file mode 100644 index 0000000..48c15d1 Binary files /dev/null and b/fig/github-repo-after-first-push.png differ diff --git a/fig/merge.png b/fig/merge.png new file mode 100644 index 0000000..321b7ea Binary files /dev/null and b/fig/merge.png differ diff --git a/fig/play-changes.png b/fig/play-changes.png new file mode 100644 index 0000000..9f975dd Binary files /dev/null and b/fig/play-changes.png differ diff --git a/fig/conflict.svg b/fig/svg/conflict.svg similarity index 100% rename from fig/conflict.svg rename to fig/svg/conflict.svg diff --git a/fig/git-checkout.svg b/fig/svg/git-checkout.svg similarity index 100% rename from fig/git-checkout.svg rename to fig/svg/git-checkout.svg diff --git a/fig/git-committing.svg b/fig/svg/git-committing.svg similarity index 100% rename from fig/git-committing.svg rename to fig/svg/git-committing.svg diff --git a/fig/git-freshly-made-github-repo.svg b/fig/svg/git-freshly-made-github-repo.svg similarity index 100% rename from fig/git-freshly-made-github-repo.svg rename to fig/svg/git-freshly-made-github-repo.svg diff --git a/fig/git-staging-area.svg b/fig/svg/git-staging-area.svg similarity index 100% rename from fig/git-staging-area.svg rename to fig/svg/git-staging-area.svg diff --git a/fig/git_staging.svg b/fig/svg/git_staging.svg similarity index 100% rename from fig/git_staging.svg rename to fig/svg/git_staging.svg diff --git a/fig/github-collaboration.svg b/fig/svg/github-collaboration.svg similarity index 100% rename from fig/github-collaboration.svg rename to fig/svg/github-collaboration.svg diff --git a/fig/github-repo-after-first-push.svg b/fig/svg/github-repo-after-first-push.svg similarity index 100% rename from fig/github-repo-after-first-push.svg rename to fig/svg/github-repo-after-first-push.svg diff --git a/fig/merge.svg b/fig/svg/merge.svg similarity index 100% rename from fig/merge.svg rename to fig/svg/merge.svg diff --git a/fig/play-changes.svg b/fig/svg/play-changes.svg similarity index 100% rename from fig/play-changes.svg rename to fig/svg/play-changes.svg diff --git a/fig/versions.svg b/fig/svg/versions.svg similarity index 100% rename from fig/versions.svg rename to fig/svg/versions.svg diff --git a/fig/versions.png b/fig/versions.png new file mode 100644 index 0000000..983eae3 Binary files /dev/null and b/fig/versions.png differ diff --git a/index.md b/index.md index cf99c84..492fa28 100644 --- a/index.md +++ b/index.md @@ -2,15 +2,12 @@ layout: lesson root: . --- - -Wolfman and Dracula have been hired by Universal Missions (a space -services spinoff from Euphoric State University) to investigate if it -is possible to send their next planetary lander to Mars. They want to -be able to work on the plans at the same time, but they have run into +Here's our scenario. Two researchers, Samit and Jane, are working on a software development project to write some code and supporting documentation to analyse post-operative inflammation data recorded from patients on a number of wards in the local hospital. +They want to be able to work on the plans at the same time, but they have run into problems doing this in the past. If they take turns, each one will spend a lot of time waiting for the other to finish, but if they work on their own copies and email changes back and forth things will be -lost, overwritten, or duplicated. +lost, overwritten, or duplicated. They know, from past experience that this is a very inefficient way of working. A colleague suggests using [version control]({{ page.root }}/reference/#version-control) to manage their work. Version control is better than mailing files back and forth: