diff --git a/_config.yml b/_config.yml index bda10bd..5bff8ab 100644 --- a/_config.yml +++ b/_config.yml @@ -6,10 +6,10 @@ carpentry: "swc" # Overall title for pages. -title: "Version Control with Git" +title: "SWD2: Version Control with Git and Github" # Contact email address. -email: lessons@software-carpentry.org +email: m.callaghan@leeds.ac.uk #------------------------------------------------------------ # Generic settings (should not need to change). diff --git a/_episodes/01-basics.md b/_episodes/01-basics.md index a4be677..d1ca84f 100644 --- a/_episodes/01-basics.md +++ b/_episodes/01-basics.md @@ -33,7 +33,7 @@ think of it as a tape: if you rewind the tape and start at the base document, then you can play back each change and end up with your latest version. -![Changes Are Saved Sequentially](../fig/play-changes.svg) +![Changes Are Saved Sequentially](../fig/play-changes.png) Once you think of changes as separate from the document itself, you can then think about "playing back" different sets of changes onto the @@ -41,11 +41,11 @@ base document and getting different versions of the document. For example, two users can make independent sets of changes based on the same document. -![Different Versions Can be Saved](../fig/versions.svg) +![Different Versions Can be Saved](../fig/versions.png) Unless there are conflicts, you can even play two sets of changes onto the same base document. -![Multiple Versions Can be Merged](../fig/merge.svg) +![Multiple Versions Can be Merged](../fig/merge.png) A version control system is a tool that keeps track of these changes for us and helps us version and merge our files. It allows you to diff --git a/_episodes/04-changes.md b/_episodes/04-changes.md index 8f1a7cd..d4ec19d 100644 --- a/_episodes/04-changes.md +++ b/_episodes/04-changes.md @@ -364,7 +364,7 @@ but not yet committed. > than you would like. {: .callout} -![The Git Staging Area](../fig/git-staging-area.svg) +![The Git Staging Area](../fig/git-staging-area.png) Let's watch as our changes to a file move from our editor to the staging area @@ -607,7 +607,7 @@ we first need to add the changed files to the staging area (`git add`) and then commit the staged changes to the repository (`git commit`): -![The Git Commit Workflow](../fig/git-committing.svg) +![The Git Commit Workflow](../fig/git-committing.png) > ## Choosing a Commit Message > diff --git a/_episodes/05-history.md b/_episodes/05-history.md index 3028bf3..a17d541 100644 --- a/_episodes/05-history.md +++ b/_episodes/05-history.md @@ -198,7 +198,7 @@ $ cat project.txt {: .bash} ~~~ -We could use Github, Gitlab or Bitbucket to host our code. +Notes on what scripts we need to write. ~~~ {: .output} @@ -219,6 +219,7 @@ Changes not staged for commit: 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 @@ -246,7 +247,7 @@ As you might guess from its name, In this case, we're telling Git that we want to recover the version of the file recorded in `HEAD`, which is the last saved commit. -If we want to go back even further, +If we want to go back even further, say to the first commit, we can use a commit identifier instead: ~~~ @@ -260,7 +261,7 @@ $ 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} @@ -315,12 +316,12 @@ the commit in which we made the change we're trying to get rid of. In the example below, we want to retrieve the state from before the most recent commit (`HEAD~1`), which is commit `f22b25e`: -![Git Checkout](../fig/git-checkout.svg) +![Git Checkout](../fig/git-checkout.png) So, to put it all together, here's how Git works in cartoon form: -![https://figshare.com/articles/How_Git_works_a_cartoon/1328266](../fig/git_staging.svg) +![https://figshare.com/articles/How_Git_works_a_cartoon/1328266](../fig/git_staging.png) > ## Simplifying the Common Case > @@ -411,29 +412,29 @@ moving backward and forward in time becomes much easier. > 1. > > ~~~ -> Venus is too hot to be suitable as a base +> We need to think about the statistical techniques to apply > ~~~ > {: .output} > > 2. > > ~~~ -> Venus is beautiful and full of love +> So that we have defensible conclusions > ~~~ > {: .output} > > 3. > > ~~~ -> Venus is beautiful and full of love -> Venus is too hot to be suitable as a base +> We need to think about the statistical techniques to apply +> So that we have defensible conclusions > ~~~ > {: .output} > > 4. > > ~~~ -> Error because you have changed venus.txt without committing the changes +> Error because you have changed analysis.txt without committing the changes > ~~~ > {: .output} > @@ -441,51 +442,51 @@ moving backward and forward in time becomes much easier. > > > > Line by line: > > ~~~ -> > $ cd planets +> > $ cd inflammation > > ~~~ > > {: .bash} -> > Enters into the 'planets' directory +> > Enters into the 'inflammation' directory > > > > ~~~ -> > $ nano venus.txt #input the following text: Venus is beautiful and full of love +> > $ nano analysis.txt #input the following text: We need to think about the statistical techniques to apply > > ~~~ > > {: .bash} > > We created a new file and wrote a sentence in it, but the file is not tracked by git. > > > > ~~~ -> > $ git add venus.txt +> > $ git add analysis.txt > > ~~~ > > {: .bash} > > Now the file is staged. The changes that have been made to the file until now will be committed in the next commit. > > > > ~~~ -> > $ nano venus.txt #add the following text: Venus is too hot to be suitable as a base +> > $ nano analysis.txt #add the following text: So that we have defensible conclusions > > ~~~ > > {: .bash} > > The file has been modified. The new changes are not staged because we have not added the file. > > > > ~~~ -> > $ git commit -m "Comment on Venus as an unsuitable base" +> > $ git commit -m "Thoughts on statistical techniques" > > ~~~ > > {: .bash} -> > The changes that were staged (Venus is beautiful and full of love) have been committed. The changes that were not staged (Venus is too hot to be suitable as a base) have not. Our local working copy is different than the copy in our local repository. +> > The changes that were staged (We need to think about the statistical techniques to apply) have been committed. The changes that were not staged (So that we have defensible conclusions) have not. Our local working copy is different than the copy in our local repository. > > > > ~~~ -> > $ git checkout HEAD venus.txt +> > $ git checkout HEAD analysis.txt > > ~~~ > > {: .bash} > > With checkout we discard the changes in the working directory so that our local copy is exactly the same as our HEAD, the most recent commit. > > > > ~~~ -> > $ cat venus.txt #this will print the contents of venus.txt to the screen +> > $ cat analysis.txt #this will print the contents of analysis.txt to the screen > > ~~~ > > {: .bash} -> > If we print venus.txt we will get answer 2. +> > If we print analysis.txt we will get answer 1. > > > {: .solution} {: .challenge} -> ## Checking Understanding of `git diff` +> ## Checking Understanding of git diff > > 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? @@ -508,7 +509,7 @@ moving backward and forward in time becomes much easier. > Exploring history is an important part of git, often it is a challenge to find > the right commit ID, especially if the commit is from several months ago. > -> Imagine the `planets` project has more than 50 files. +> Imagine the `inflammation` project has more than 50 files. > 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? diff --git a/_episodes/07-github.md b/_episodes/07-github.md index 6456bcd..b290f92 100644 --- a/_episodes/07-github.md +++ b/_episodes/07-github.md @@ -172,7 +172,7 @@ To https://github.com/ARCTraining/inflammation.git Our local and remote repositories are now in this state: -![GitHub Repository After First Push](../fig/github-repo-after-first-push.svg) +![GitHub Repository After First Push](../fig/github-repo-after-first-push.png) > ## The '-u' Flag > diff --git a/_episodes/08-collab.md b/_episodes/08-collab.md index 25d58f9..1537cf5 100644 --- a/_episodes/08-collab.md +++ b/_episodes/08-collab.md @@ -45,7 +45,7 @@ $ git clone https://github.com/jane/inflammation.git ~/Desktop/jane-inflammation Replace `jane` with the correct username for your collaborator. -![After Creating Clone of Repository](../fig/github-collaboration.svg) +![After Creating Clone of Repository](../fig/github-collaboration.png) 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: diff --git a/_episodes/09-conflict.md b/_episodes/09-conflict.md index 5153a14..d9b57fd 100644 --- a/_episodes/09-conflict.md +++ b/_episodes/09-conflict.md @@ -213,10 +213,15 @@ $ 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} diff --git a/fig/github-collaboration.png b/fig/github-collaboration.png index 65a9fdc..e458b43 100644 Binary files a/fig/github-collaboration.png and b/fig/github-collaboration.png differ diff --git a/setup.md b/setup.md index 9392974..13d01e6 100644 --- a/setup.md +++ b/setup.md @@ -4,9 +4,6 @@ title: Setup permalink: /setup/ --- -Please see [this section of the workshop template][workshop-setup] -for instructions on installing Git. - We'll do our work in the `Desktop` folder so make sure you change your working directory to it with: ~~~ @@ -15,4 +12,3 @@ $ cd Desktop ~~~ {: .bash} -[workshop-setup]: https://swcarpentry.github.io/workshop-template/#git