forked from swcarpentry/git-novice
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adapt content to outbreak context and R packages #13
Merged
Merged
Changes from 151 commits
Commits
Show all changes
153 commits
Select commit
Hold shift + click to select a range
654c458
update config
avallecam 7adf8b2
add introduction and section on file types
avallecam 4450cc5
add git config from rstudio console
avallecam d25ceda
add create repo in next episode
avallecam 8332637
replace motivation with video
avallecam e2568b8
add link to discussion tab
avallecam dec3f99
add r rstudio packages installation
avallecam bf038b5
add figures for episode 01-basics and 02-setup
avallecam bd14b86
replace planet with outbreak scenario
avallecam 2a552ab
add rstudio console reference for setup
avallecam b9d7489
replace to cases and interventions with usethis
avallecam 431e60a
block the branch main chunk
avallecam e468b03
add intro about git jargon
avallecam 0f46360
move git init to rstudio console section
avallecam b2c51fc
add subtitle to create repo
avallecam 38e553b
add git init verb figure
avallecam 08590fe
paste figures to episode
avallecam f977ce2
add episode 03
avallecam 0a1d98a
add figures of terminal pane and motivation example
avallecam b36d56d
add checklist and fix figure
avallecam c42107a
add scenario figure in index
avallecam 72375fe
fix figure and chunk outputs
avallecam 049414d
add figure to scenario in index
avallecam feb20a9
add section using the terminal
avallecam c37dbb3
replace planets with cases
avallecam 91a798e
add subtitles to episode 04
avallecam f446beb
add notes + replace create file with usethis
avallecam de7f6cd
add chapter 04-changes
avallecam 3539c7f
add episode 14 with supplementary rstudio
avallecam 68bdc8c
replace venus with data, txt with md, and notes
avallecam edb9f5a
add summary figure add commit status log diff
avallecam 1a9fa64
add in-terminal specification + subtitle rename
avallecam 09497b2
update length
avallecam 6c13ef0
update batch name
avallecam 8d2b561
add console an terminal figures
avallecam 8995f48
reduce length of title
avallecam d2500a1
add time lenght of video
avallecam a9911bd
remove gert spoilers
avallecam 60905cf
add prerequisite callout of R and Bash code
avallecam 6981a51
add create token subtitle
avallecam 505020e
fix figure + add terminal earlier
avallecam ab01d13
add emphasis on terminal and console exchange
avallecam 08020bb
add git token figure
avallecam d86ce1b
fix subtitle
avallecam 3101247
connect with next episode
avallecam eb5feab
connect usefulness of buttons in next episodes
avallecam 998bcb6
add git init callout
avallecam be494ba
remove mention to different editors
avallecam 016a5f2
add subtitles
avallecam 422b11d
add instructor note on git_sitrep
avallecam b2909d5
homogenize verifications with usethis sitrep
avallecam b4396cd
add token definition
avallecam f0ee235
add that pat is the credential
avallecam 4741ea2
replace data with analyses folder
avallecam ba1a7f0
fix typos
avallecam 79cbc5d
add reference to previous episode
avallecam cbf1165
add episode 05-history
avallecam 2797420
add format to keypoints
avallecam c07e1bf
add save file before terminal action + clean Rmd
avallecam 7ced5ad
change name of analysis files
avallecam fb3d245
replace planets story with cases
avallecam 6f1274f
remove temporal reference to git init in episode14
avallecam 53b4e8f
update text about extra episode
avallecam a091271
move rstudio how-tos to testimonial at the end
avallecam ac94c49
add further reading testimonial of similar commands
avallecam bd5da6e
add updated blogpost on top of episode
avallecam a7b0ca5
remove console and terminal words from prereq
avallecam 4b11ec2
show bash tutorial at the end of solution
avallecam 72bd619
add definitions visible on status log
avallecam 89d95fd
add clear guide to not change editor in rstudio
avallecam 351e59e
add bold to terminal or command tab
avallecam c43341d
fix link to previous episode
avallecam ec2cbdf
add terminal detail to callout action
avallecam 1178cd2
fix typos in subtitles
avallecam a2c00ac
add link to quick reference links
avallecam d54b9a6
add hint callout and link to git reference docu
avallecam ebb8dbc
translate to outbreak and rcompendium story
avallecam bb3c275
add episode 06-ignore
avallecam b0261ff
add subtitles and bold to console or terminal
avallecam 299f230
replace graphs with output folder name
avallecam 09f38ef
show proxy for users that need it
avallecam 1c1afd2
fix reference
avallecam 6436296
add fixme section
avallecam 702fcc5
add prereq using usethis git sitrep
avallecam 690e4df
add episode 07
avallecam 11aa9ea
add prereq and open how to create project.
avallecam 3af42a5
replace ssh with https protocol
avallecam c484667
add fixme tag
avallecam 9d6d77a
add episode 13 associated with episode 07
avallecam fac4f0c
fix text after html review
avallecam d05790a
add episodes 08-collab and 15-wrapup
avallecam f65b3af
replace link to read about undoing commits changes
avallecam f40fcd7
update figures for episode 07-github
avallecam be8af63
add checklist concept figure at the end
avallecam 9c6a009
fix checklist concept figures paths
avallecam 2958456
add complementary episodes
avallecam f309534
add wrap up after all episodes with git commands
avallecam 6d89198
fix figure paths
avallecam 2f7626f
add wrapup from template
avallecam 6525ea3
remove rstudio testimonial
avallecam bce3c30
fix figure output
avallecam 0e8f285
add reference to rstudio episode
avallecam 8581a67
add supplemental rstudio on top
avallecam e3e484d
replace raw and derived folder names
avallecam 504c22f
hide verb command divisions
avallecam 4f5430f
change planets to outbreak scenario
avallecam 4771ddc
add and update concept map figures
avallecam fd5a65d
add new figures for episode 08
avallecam 8e543af
add introduction on top
avallecam 6f9a04c
add github profile challenge
avallecam 9ede636
edit figure, add bold to role, add subtitle
avallecam d2fbfd6
recover subtitle
avallecam fdc74e7
fix typos from first review
avallecam 3fe2c93
update fetch figure
avallecam 36b6c7f
translate content from space to outbreak
avallecam ce14789
add episode 09 conflict
avallecam b6113d5
fix intro readability
avallecam 2fb6dcb
add figures for episode 14 rstudio
avallecam 624b121
add figures and sections
avallecam 1a1e0a8
rename episode title
avallecam 839a7f0
remove fixme chunk
avallecam 7b448a1
relocate callout about gitignore
avallecam 1874054
add feature branches keypoint
avallecam 57a56ac
add git tab as alternative
avallecam 3442020
detail change of tab
avallecam 32869fa
reduce size of figures
avallecam 90d877a
recover the supplemental name of episode
avallecam c4ab835
inform about the create branch episode
avallecam 57f0735
add intro section and checklist at the end
avallecam 8d895f8
add reference on plain text files
avallecam f0ceffa
add good practice box on commit length
avallecam 40a225b
add good practice chunk + keypoint + fix typo
avallecam 326e288
add subtitle section on atomic commits
avallecam f3c5b32
add good collaboration practices
avallecam 8325627
add figures for atomic commit
avallecam 55d0e18
add git tab figure
avallecam d32c8d0
add checklist to complementary links
avallecam df50401
fix writing typos for clarity
avallecam 77ff30d
fix writing typos for clarity
avallecam cb3f384
add edit for simpler phrasing
avallecam 4ad4476
add scopes descriptions for token
avallecam 0cb5ebe
add callout on scopes options
avallecam f7bf947
remove the proxy callout to visible content
avallecam bd5d2f0
add capital letter to Git as noun
avallecam 3aab915
add once per session or computer figure
avallecam 839b6d8
Merge branch 'dev-adapt-v2' of https://github.com/epiverse-trace/git-…
avallecam ce79e0d
add hidden file figures
avallecam c9a6c52
fix for clarity
avallecam b685ede
fix for clarity
avallecam 09ccd1a
edit keypoint for clarity
avallecam b3443dd
add callout to avoid confusion of a new git space
avallecam 0b4de95
relocate good practice callout to avoid redundancy
avallecam 9e2d04f
Merge branch 'main' of https://github.com/epiverse-trace/git-rstudio-…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,10 @@ | |
# lc: Library Carpentry | ||
# cp: Carpentries (to use for instructor training for instance) | ||
# incubator: The Carpentries Incubator | ||
carpentry: 'swc' | ||
carpentry: 'incubator' | ||
|
||
# Overall title for pages. | ||
title: 'Version Control with Git' | ||
title: 'Version Control with Git in Rstudio' | ||
|
||
# Date the lesson was created (YYYY-MM-DD, this is empty by default) | ||
created: '2014-12-04' | ||
|
@@ -21,19 +21,19 @@ keywords: 'software, data, lesson, The Carpentries' | |
|
||
# Life cycle stage of the lesson | ||
# possible values: pre-alpha, alpha, beta, stable | ||
life_cycle: 'stable' | ||
life_cycle: 'alpha' | ||
|
||
# License of the lesson materials (recommended CC-BY 4.0) | ||
license: 'CC-BY 4.0' | ||
|
||
# Link to the source repository for this lesson | ||
source: 'https://github.com/swcarpentry/git-novice' | ||
source: 'https://github.com/epiverse-trace/git-rstudio-basics' | ||
|
||
# Default branch of your lesson | ||
branch: 'main' | ||
|
||
# Who to contact if there are any issues | ||
contact: '[email protected]' | ||
contact: '[email protected]' | ||
|
||
# Navigation ------------------------------------------------ | ||
# | ||
|
@@ -58,7 +58,7 @@ contact: '[email protected]' | |
# - another-learner.md | ||
|
||
# Order of episodes in your lesson | ||
episodes: | ||
episodes: | ||
- 01-basics.md | ||
- 02-setup.md | ||
- 03-create.md | ||
|
@@ -68,27 +68,28 @@ episodes: | |
- 07-github.md | ||
- 08-collab.md | ||
- 09-conflict.md | ||
- 15-wrapup.md | ||
- 14-supplemental-rstudio.md | ||
- 10-open.md | ||
- 11-licensing.md | ||
- 12-citation.md | ||
- 13-hosting.md | ||
- 14-supplemental-rstudio.md | ||
|
||
# Information for Learners | ||
learners: | ||
learners: | ||
|
||
# Information for Instructors | ||
instructors: | ||
instructors: | ||
|
||
# Learner Profiles | ||
profiles: | ||
profiles: | ||
|
||
# Customisation --------------------------------------------- | ||
# | ||
# This space below is where custom yaml items (e.g. pinning | ||
# sandpaper and varnish versions) should live | ||
|
||
|
||
url: 'https://swcarpentry.github.io/git-novice' | ||
analytics: carpentries | ||
lang: en | ||
# url: 'https://swcarpentry.github.io/git-novice' | ||
# analytics: carpentries | ||
# lang: en |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
title: Automated Version Control | ||
teaching: 5 | ||
exercises: 0 | ||
teaching: 15 | ||
exercises: 10 | ||
--- | ||
|
||
::::::::::::::::::::::::::::::::::::::: objectives | ||
|
@@ -17,20 +17,60 @@ | |
|
||
:::::::::::::::::::::::::::::::::::::::::::::::::: | ||
|
||
We'll start by exploring how version control can be used | ||
to keep track of what one person did and when. | ||
## Tracking changes | ||
|
||
We'll start by exploring how we are usually introduced to version control to keep track of what one person did and when. | ||
Even if you aren't collaborating with other people, | ||
automated version control is much better than this situation: | ||
version control may have look like this situation: | ||
|
||
![Tracking changes for the `manuscript.docx` file.](fig/git-manual-version-system.png){alt='One same files called manuscript with modification dates as prefix and what a person did as sufix.'} | ||
|
||
We all started by replicating the Version control system of our initial community. We all need to differentiate files from previous versions or different colleagues (supervisors or reviewers). For those reasons, we tag each version to track what one person did (e.g., with a suffix) or when (e.g., with a prefix). | ||
|
||
Does it seem unnecessary to you to have multiple nearly identical versions of the same document? Possibly yes. But this Version control system opens the possibility of returning to a specific version in case you erased something that you think now is essential. | ||
|
||
::::::::::::::::: discussion | ||
|
||
### File names to track changes | ||
|
||
Write down: | ||
|
||
- Is there any file naming convention that is familiar to you? | ||
|
||
!["notFinal.doc" by Jorge Cham, <https://www.phdcomics.com>](fig/phd101212s.png){alt='Comic: a PhD student sends "FINAL.doc" to their supervisor, but after several increasingly intense and frustrating rounds of comments and revisions they end up with a file named "FINAL_rev.22.comments49.corrections.10.#@$%WHYDIDCOMETOGRADSCHOOL????.doc"'} | ||
- What was the version control system that you first used? | ||
|
||
We've all been in this situation before: it seems unnecessary to have | ||
multiple nearly-identical versions of the same document. Some word | ||
- Share with us your favorite prefix or suffix! | ||
|
||
::::::::::::::::::::::::::::: | ||
|
||
::::::::::::::::::: instructor | ||
|
||
We can use the comments or live participation as ice-breaker. | ||
|
||
:::::::::::::::::::::::::::::: | ||
|
||
Some word | ||
processors let us deal with this a little better, such as Microsoft | ||
Word's | ||
[Track Changes](https://support.office.com/en-us/article/Track-changes-in-Word-197ba630-0f5f-4a8e-9a77-3712475e806a), | ||
Google Docs' [version history](https://support.google.com/docs/answer/190843?hl=en), or | ||
LibreOffice's [Recording and Displaying Changes](https://help.libreoffice.org/Common/Recording_and_Displaying_Changes). | ||
LibreOffice's [Recording and Displaying Changes](https://help.libreoffice.org/Common/Recording_and_Displaying_Changes). Let's illustrate how Google Docs works. | ||
|
||
![Tracking changes for the `git-test` file.](fig/gdocs-01.png) | ||
|
||
To use Google Docs version history click `File` > `Version history` > `See version history`. This highlights the new content added to the file in that version only. | ||
|
||
![The most recent version of the `git-test` file is called "third version".](fig/gdocs-03.png) | ||
|
||
We can move to any previous version tagged with two metadata values: the modification date and the name of the author. | ||
|
||
![We can view the "first version" of the file `git-test`. We can also restore it with the `Restore this version` button.](fig/gdocs-04.png) | ||
|
||
Google Docs’ version history tool is an automatic Version control system for single Word/Doc files that works online. | ||
|
||
![The Turing Way project illustration by Scriberia. Used under a CC-BY 4.0 licence. DOI: <https://zenodo.org/doi/10.5281/zenodo.3332807>.](fig/ProjectHistory.jpg) | ||
|
||
## Version control systems | ||
|
||
Version control systems start with a base version of the document and | ||
then record changes you make each step of the way. You can | ||
|
@@ -42,26 +82,34 @@ | |
|
||
Once you think of changes as separate from the document itself, you | ||
can then think about "playing back" different sets of changes on the base document, ultimately | ||
resulting in different versions of that document. For example, two users can make independent | ||
sets of changes on the same document. | ||
|
||
![](fig/versions.svg){alt='Different Versions Can be Saved'} | ||
|
||
Unless multiple users make changes to the same section of the document - a conflict - you can | ||
incorporate two sets of changes into the same base document. | ||
|
||
![](fig/merge.svg){alt='Multiple Versions Can be Merged'} | ||
resulting in different versions of that document. | ||
|
||
A version control system is a tool that keeps track of these changes for us, | ||
effectively creating different versions of our files. It allows us to decide | ||
effectively creating different versions of our files. | ||
|
||
<!-- | ||
It allows us to decide | ||
which changes will be made to the next version (each record of these changes is | ||
called a [commit](../learners/reference.md#commit)), and keeps useful metadata | ||
about them. The complete history of commits for a particular project and their | ||
metadata make up a [repository](../learners/reference.md#repository). | ||
Repositories can be kept in sync across different computers, facilitating | ||
collaboration among different people. | ||
--> | ||
|
||
::::::::::::::::: checklist | ||
|
||
### Checklist | ||
|
||
Key characteristics of Version control systems are: | ||
|
||
1. Keep the entire history of a file and inspect a file throughout its lifetime. | ||
|
||
::::::::::::::::::::::::::::::::::::::::: callout | ||
2. Tag a particular version so you can return to them easily. | ||
|
||
::::::::::::::::::::::::::: | ||
|
||
::::::::::::::::::::::::::::::::::::::::: instructor | ||
|
||
## The Long History of Version Control Systems | ||
|
||
|
@@ -95,33 +143,71 @@ | |
|
||
## Solution | ||
|
||
- Recovering the excellent version is only possible if you created a copy | ||
of the old version of the paper. The danger of losing good versions | ||
often leads to the problematic workflow illustrated in the PhD Comics | ||
cartoon at the top of this page. | ||
|
||
- Collaborative writing with traditional word processors is cumbersome. | ||
Either every collaborator has to work on a document sequentially | ||
(slowing down the process of writing), or you have to send out a | ||
version to all collaborators and manually merge their comments into | ||
your document. The 'track changes' or 'record changes' option can | ||
highlight changes for you and simplifies merging, but as soon as you | ||
accept changes you will lose their history. You will then no longer | ||
know who suggested that change, why it was suggested, or when it was | ||
merged into the rest of the document. Even online word processors like | ||
Google Docs or Microsoft Office Online do not fully resolve these | ||
problems. | ||
|
||
|
||
- Recovering the excellent version is only possible if you created a copy of the old version of the paper. The danger of losing good versions often leads to the problematic workflow illustrated in [this popular PhD Comics cartoon](https://phdcomics.com/comics/archive.php?comicid=1531). | ||
|
||
- Collaborative writing with traditional word processors is cumbersome. Either every collaborator has to work on a document sequentially (slowing down the process of writing), or you have to send out a version to all collaborators and manually merge their comments into your document. The 'track changes' or 'record changes' option can highlight changes for you and simplifies merging, but as soon as you accept changes you will lose their history. You will then no longer know who suggested that change, why it was suggested, or when it was merged into the rest of the document. Even online word processors like Google Docs or Microsoft Office Online do not fully resolve these problems. Remember this for the collaboration episode! | ||
|
||
::::::::::::::::::::::::: | ||
|
||
:::::::::::::::::::::::::::::::::::::::::::::::::: | ||
|
||
## Version control and R files | ||
|
||
For code-like files like `.R` and `.Rmd` files, we can not use Google docs. The software and strategy to track changes in a project depends on the **file type**. | ||
|
||
- Google Docs’ version history tool is a Version control software optimized for single [non-plain text files](https://github.com/epiverse-trace/git-rstudio-basics/discussions/11) like Word/Doc files that works online. | ||
|
||
- `Git` is the Version control software optimized for [plain text files](https://en.wikipedia.org/wiki/Plain_text) that works offline. (Read: “What Not to Put Under Version Control” at [G. Wilson et al. 2017](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1005510#sec014)) | ||
|
||
Plain text files can be text, code, and data. Example for each of these are Markdown files (`.md`), R files (`.R`), and `.csv` or `.tsv` files, respectively. | ||
|
||
![Examples of non-plain and plain text files.](fig/plain-text-files.png) | ||
|
||
::::::::::::::::: callout | ||
|
||
We can use `Git` to track changes of these plain text files. However, for [plain text data files](https://www.r4epi.com/importing-plain-text-files.html) (like `.csv` and `.tsv`) we prefer different version control systems. | ||
|
||
::::::::::::::::::::::::: | ||
|
||
Plain text files like Markdown files (`.md`) and R files (`.R`) are integrated in Rmarkdown files (`.Rmd`) to generate manuscripts, websites, and R packages. These three products are outputs of **Open Science** projects, that leads to *Reproducible research* and *Sustainable software*. | ||
|
||
|
||
![We can increase the reproducibility of our Open science projects with version control sytems like `Git`. Text and final results can be connected and executable by Data and code. From: "Ciencia reproducible: qué, por qué, cómo" <https://www.revistaecosistemas.net/index.php/ecosistemas/article/view/1178>](fig/gradient-reproducibility.png) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This figure's text is in Spanish, not sure if that is intended. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cited in new issue #22 |
||
|
||
::::::::::::::::::: instructor | ||
|
||
### Concept map | ||
|
||
![Concept map for automatic version control.](fig/git-concept-03.drawio.png) | ||
|
||
:::::::::::::::::::::::::::::: | ||
|
||
::::::::::::::::: discussion | ||
|
||
### Exercise! | ||
|
||
Tell us about your Open Science project and its file types! | ||
|
||
- Briefly share about one Open Science project in which they are involved or would like to start soon (e.g. thesis, current project, or work); | ||
- Identify the most relevant file types (`.pdf`, `.jpge`, `.csv`, `.xlsx`, `.R`, `.docx`, `.Rmd`) involved in it and classify them as non-plain or plain text files; | ||
- Discuss which ones can use a Version control software like Git? | ||
|
||
:::::::::::::::::::::::::::: | ||
|
||
::::::::::::::::::: instructor | ||
|
||
This exercise can be solved in the shared document of the training. | ||
|
||
:::::::::::::::::::::::::::::: | ||
|
||
:::::::::::::::::::::::::::::::::::::::: keypoints | ||
|
||
- Version control is like an unlimited 'undo'. | ||
- Version control record changes you make "step-by-step". | ||
- `Git` is a Version control software optimized for plain text files, like `.R` and `.Rmd` files. | ||
|
||
<!-- | ||
- Version control also allows many people to work in parallel. | ||
--> | ||
|
||
:::::::::::::::::::::::::::::::::::::::::::::::::: | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This screenshot is of google docs but in the image it says "Word's version control is similar to Git"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cited as an issue in #21