{ "cells": [ { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "25fcfe4766b859ec91acec3e6a85254f", "grade": false, "grade_id": "cell-9fc931a1b92d396c", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "source": [ "# Worksheet 5: Introduction to version control\n", "\n", "\n", "\n", "\n", "### Lecture and Tutorial Learning Goals:\n", "\n", "After completing this week's lecture and tutorial work, you will be able to:\n", "\n", "* Describe what version control is and why data analysis projects can benefit from it\n", "* Create a remote version control repository on GitHub\n", "* Move changes to files from GitHub to JupyterHub, and from JupyterHub to GitHub\n", "* Give collaborators access to the repository\n", "* Resolve conflicting edits made by multiple collaborators\n", "* Communicate with collaborators using issues\n", "* Use best practices when collaborating on a project with others\n", "\n", "This worksheet covers parts of [the Version Control chapter](https://datasciencebook.ca/version-control.html) of the online textbook. You should read this chapter before attempting the worksheet." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "code", "checksum": "e96e5e753bee34608a4d2a300326ce10", "grade": false, "grade_id": "cell-4c6ba62a17e1fc56", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "outputs": [], "source": [ "### Run this cell before continuing. \n", "source(\"tests.R\")\n", "source(\"cleanup.R\")" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "32ddce9f7b2244bd1a5f36d10b074427", "grade": false, "grade_id": "cell-3b8465487dd766f5", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "source": [ "## 1. What is version control? Why use it? " ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "714678afc92e935cf4e6fc28570fe9d2", "grade": false, "grade_id": "cell-33341d6ba389a6a5", "locked": true, "schema_version": 3, "solution": false } }, "source": [ "**Question 1.1** Multiple Choice:\n", "
{points: 1}\n", "\n", "Which reason listed below **is not** a good reason to use version control:\n", "\n", "A. Version control tools provide transparency on how a project evolved by tracking the history of documents, and who made what changes to those documents.\n", "\n", "B. Version control tools usually include a remote/cloud repository hosting service that can act as a backup of your local files (i.e., the files on your computer).\n", "\n", "C. In practice, most data science projects involve collaboration on documents that contain code (e.g., Jupyter notebooks), and version control tools facilitate collaboration on such documents.\n", "\n", "D. Version control tools check the accuracy of your code. \n", "\n", "*Assign your answer to an object called `answer1.1`. Make sure your answer is an uppercase letter and is surrounded by quotation marks (e.g. `\"F\"`).*" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "nbgrader": { "cell_type": "code", "checksum": "fcf288b0c2a750bfc3d5d16cea2f0456", "grade": false, "grade_id": "cell-6bdc2f57a189abcf", "locked": false, "schema_version": 3, "solution": true } }, "outputs": [], "source": [ "# Replace the fail() with your answer. \n", "\n", "# your code here\n", "fail() # No Answer - remove if you provide an answer" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "code", "checksum": "95a8391a2ccb7db143ea5c1bb86d6476", "grade": true, "grade_id": "cell-62f0d28a4d321e00", "locked": true, "points": 1, "schema_version": 3, "solution": false } }, "outputs": [], "source": [ "test_1.1()" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "23f52366f7a1f5b900cb71535c841634", "grade": false, "grade_id": "cell-b91542cf20075a6d", "locked": true, "schema_version": 3, "solution": false } }, "source": [ "**Question 1.2** True or false: \n", "
{points: 1}\n", "\n", "**Git** is a remote/cloud repository hosting service where you can backup and share your files with collaborators.\n", "\n", "*Assign your answer to an object called `answer1.2`. Make sure your answer is written in lowercase and is surrounded by quotation marks (e.g. `\"true\"` or `\"false\"`).* " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "nbgrader": { "cell_type": "code", "checksum": "67df28e702c357988b3ffe66dbb754aa", "grade": false, "grade_id": "cell-419826637ad2ec8b", "locked": false, "schema_version": 3, "solution": true } }, "outputs": [], "source": [ "# Replace the fail() with your answer. \n", "\n", "# your code here\n", "fail() # No Answer - remove if you provide an answer" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "code", "checksum": "f118e4132ee94403fc4a25fea9ec1314", "grade": true, "grade_id": "cell-decda128ce0061b5", "locked": true, "points": 1, "schema_version": 3, "solution": false } }, "outputs": [], "source": [ "test_1.2()" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "745b8e4e4f9461ca2fb9651c8f873902", "grade": false, "grade_id": "cell-201bce97876c61d9", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "source": [ "## 2. Creating a space for your data science project online\n", "\n", "For the rest of this worksheet, you will create a toy data science project on GitHub to practice using Git and GitHub. We will ask you questions about what you are doing along the way to test your understanding.\n", "\n", "#### Signup for a free GitHub.com account:\n", "If you do not already have a free GitHub.com account, visit [GitHub.com](https://github.com/) and signup for one. Store your username and password in a secure place (we recomend using a password manager for things like this, examples of these are [LastPass](https://www.lastpass.com/), [1Password](https://1password.com/), etc).\n", "\n", "#### Create a GitHub repository:\n", "On [GitHub.com](https://github.com/) create a new repository and name it `toy_ds_project`. You can decide whether to make it private or public. Ensure that you select “Add a README file.” **This task corresponds to [this step](https://datasciencebook.ca/version-control.html#creating-a-remote-repository-on-github) in the textbook.**" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "bee3ae0d67204f545d8eed6978d95ef7", "grade": false, "grade_id": "cell-b3a3c0bfe11c30aa", "locked": true, "schema_version": 3, "solution": false } }, "source": [ "**Question 2.1** Multiple Choice:\n", "\n", "Which statement below is **not true** about GitHub repositories:\n", "
{points: 1}\n", "\n", "A. Immediately after a repository is created on GitHub.com using the website, the repository exists only on GitHub.com and does not exist on your computer (i.e., you need to do something to get a copy of it on your computer).\n", "\n", "B. Only the creator of GitHub repository, and people the creator specify, can edit the files in the repository. This is true even when the repository is public.\n", "\n", "C. If the repository is public, anyone on the web can view it.\n", "\n", "D. If the repository is public, anyone on the web can edit it.\n", "\n", "E. A GitHub repository is like a folder on Dropbox or Google Drive, but it is different in that it has special properties for version control.\n", "\n", "*Assign your answer to an object called `answer2.1`. Make sure your answer is an uppercase letter and is surrounded by quotation marks (e.g. `\"F\"`).* " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "nbgrader": { "cell_type": "code", "checksum": "6ddb42725f1a5c450b915b83c41b409b", "grade": false, "grade_id": "cell-09da6197edcf6859", "locked": false, "schema_version": 3, "solution": true } }, "outputs": [], "source": [ "# Replace the fail() with your answer. \n", "\n", "# your code here\n", "fail() # No Answer - remove if you provide an answer" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "code", "checksum": "5753d7f418ed9ecc73582e0c4490fc26", "grade": true, "grade_id": "cell-bcb67971fe82e848", "locked": true, "points": 1, "schema_version": 3, "solution": false } }, "outputs": [], "source": [ "test_2.1()" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "79f9b46f9302e7fd3c33918cd1ba4dc0", "grade": false, "grade_id": "cell-bee24c9a528da438", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "source": [ "## 3. Creating and editing files on GitHub\n", "\n", "1. Edit the `README.md` file in your `toy_ds_project` repository on GitHub.com using the pen tool. Write \"project creation date:\" and list today's date. \n", "2. Commit this change directly to the main branch and write the commit message \"added creation date\". **This task corresponds to [this step](https://datasciencebook.ca/version-control.html#editing-files-on-github-with-the-pen-tool) in the textbook.**\n", "3. Next, use the pen tool again to edit the `README.md` file. Write \"author\" and list your name as the author. Commit this change and use the commit message \"added project author\".\n", "4. Explore the commit history of your project by clicking on the link that looks like this: \n", "\n", "\n", "\n", "> Note: you can visit the version of your repository at any stage in its history by click on the `<>` buttons! Give it a try!" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "12a877cd97e6b7aadc6c83e21b3143e3", "grade": false, "grade_id": "cell-4589f01853a62fe7", "locked": true, "schema_version": 3, "solution": false } }, "source": [ "**Question 3.1** True or false:\n", "
{points: 1}\n", "\n", "Even though commit messages are required to edit a file using the pen tool on GitHub.com, what you write in the message is not important.\n", "\n", "*Assign your answer to an object called `answer3.1`. Make sure your answer is written in lowercase and is surrounded by quotation marks (e.g. `\"true\"` or `\"false\"`).* " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "nbgrader": { "cell_type": "code", "checksum": "e60f9373a8db17a71523857d9d3cf423", "grade": false, "grade_id": "cell-c7993ed9e8e63184", "locked": false, "schema_version": 3, "solution": true } }, "outputs": [], "source": [ "# Replace the fail() with your answer. \n", "\n", "# your code here\n", "fail() # No Answer - remove if you provide an answer" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "code", "checksum": "e08f581f4e6f055054e441dc1e583b0a", "grade": true, "grade_id": "cell-0a781125473dc3d8", "locked": true, "points": 1, "schema_version": 3, "solution": false } }, "outputs": [], "source": [ "test_3.1()" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "a799eb669c99ef4f0b31dfc4a983aeec", "grade": false, "grade_id": "cell-97539987da5e6f2a", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "source": [ "## 4. Cloning your repository on JupyterHub\n", "\n", "For our data science project, we need to put a copy of our repository somewhere we can run and test the code we write (otherwise, we won't know that our code works!). We can use the course JupyterHub for this!\n", "\n", "Clone a copy of this GitHub repository to the course JupyterHub using the Jupyter Git extension. **This task corresponds to [this step](https://datasciencebook.ca/version-control.html#cloning-a-repository-using-jupyter) in the textbook.**\n" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "e6bc61cf79dfb654626b2648536a2c70", "grade": false, "grade_id": "cell-798a7cbf057308b4", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "source": [ "**Question 4.1** True or false:\n", "
{points: 1}\n", "\n", "The definition of **cloning a repository** is to copy/download the entire contents (files, project history, and location of the remote repository) of a remote GitHub.com repository to a computer (e.g., your workspace on a JupyterHub, or your laptop).\n", "\n", "*Assign your answer to an object called `answer4.1`. Make sure your answer is written in lowercase and is surrounded by quotation marks (e.g. `\"true\"` or `\"false\"`).* " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "nbgrader": { "cell_type": "code", "checksum": "12d6b68b3169ecf3f7f41ea302ce1d7e", "grade": false, "grade_id": "cell-050dd93f81d2fc95", "locked": false, "schema_version": 3, "solution": true, "task": false } }, "outputs": [], "source": [ "# Replace the fail() with your answer. \n", "\n", "# your code here\n", "fail() # No Answer - remove if you provide an answer" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "code", "checksum": "004d75332f60423542beba15d0f08ddd", "grade": true, "grade_id": "cell-f4e891dadfecbbf6", "locked": true, "points": 1, "schema_version": 3, "solution": false, "task": false } }, "outputs": [], "source": [ "test_4.1()" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "fc632859a88568ebe29bfc97bdd0e378", "grade": false, "grade_id": "cell-5596109d0e6be6f8", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "source": [ "## 5. Working in a cloned repository on JupyterHub\n", "\n", "Now that your repository exists in your workspace on the course JupyterHub, you can create a new Jupyter notebook with an R kernel and write some code! To help this project move along, we show you below how to create a new Jupyter notebook and save it and some code to put in it. \n", "\n", "### Creating a new Jupyter notebook with an R kernel\n", "\n", "To create a new Jupyter notebook with an R kernel in your `toy_ds_project` repository, use the file navigation menu of Jupyter so that you are inside the `toy_ds_project`:\n", "\n", "\n", "\n", "Once there, click on new R notebook:\n", "\n", "\n", "\n", "Next, right-click on the filename and click on \"Rename\", to rename the file `marg_vs_divorce_viz.ipynb`.\n", "\n", "" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "0242131110320b2e09e5a77b2bfb6be7", "grade": false, "grade_id": "cell-cb3461dfc5b42c39", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "source": [ "\n", "### Add code to the notebook you created\n", "\n", "Add the code below to the notebook and run it to display the data visualization. Feel free to add a narrative to the notebook if you like, commenting on the question being asked, the data visualization results, and whether correlation means causation. When you are done, save the notebook.\n", "\n", "```\n", "library(tidyverse)\n", "library(cowplot)\n", "library(scales)\n", "\n", "# Data sourced from the Spurious Correlations website (http://www.tylervigen.com/spurious-correlations)\n", "should_have_bought_butter <- tibble(margarine_consumption = c(8.2, 7, 6.5, 5.3, 5.2,\n", " 4, 4.6, 4.5, 4.2, 3.7),\n", " maine_divorce_rate = c(5, 4.7, 4.6, 4.4, 4.3,\n", " 4.1, 4.2, 4.2, 4.2, 4.1),\n", " year = c(2000, 2001, 2002, 2003, 2004,\n", " 2005, 2006, 2007, 2008, 2009))\n", "\n", "marg_vs_time <- should_have_bought_butter |> \n", " ggplot(aes(x = year, y = margarine_consumption)) +\n", " geom_line(colour = \"Blue\") + \n", " labs(x = \"\", y = \"Margarine consumption \\n(lbs per capita)\", \n", " title = \"Divorce rate in Maine correlates with margarine consumption\") +\n", " theme_bw() +\n", " theme(axis.ticks.x = element_blank(),\n", " axis.text.x = element_blank()) +\n", " theme(text = element_text(size = 20)) +\n", " scale_y_continuous(labels = number_format(accuracy = 0.01))\n", "\n", "\n", "divorce_rate_vs_time <- should_have_bought_butter |> \n", " ggplot(aes(x = year, y = maine_divorce_rate)) +\n", " geom_line(colour = \"Red\") + \n", " labs(x = \"Year\", y = \"Divorce rate in Maine \\n(per 1000)\") +\n", " scale_x_continuous(breaks = 0:2100) +\n", " theme_bw() +\n", " theme(text = element_text(size = 20)) \n", "\n", "options(repr.plot.width = 11, repr.plot.height = 8)\n", "plot_grid(marg_vs_time, divorce_rate_vs_time, ncol = 1)\n", "```" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "70bc815338cfc7081fa99181735e35fc", "grade": false, "grade_id": "cell-1f6c2b4695b6022b", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "source": [ "## 6. Specifying files to commit\n", "\n", "Now we would like to start the process of putting `marg_vs_divorce_viz.ipynb` under version control and eventually push this file to our remote repository on GitHub.com. The first step to doing this is to **add** the changes to this file (creating it and the code) to the Git staging area. Go ahead and use the Jupyter Git extension to do this now. **This task corresponds to [this step](https://datasciencebook.ca/version-control.html#specifying-files-to-commit) in the textbook.**" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "82ed747352aff9d8da334c21feb8fd55", "grade": false, "grade_id": "cell-b41196d7c306a078", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "source": [ "**Question 6.1** Multiple Choice:\n", "
{points: 1}\n", "\n", "Git has a distinct step of **adding** files to the staging area because:\n", "\n", "A. Not all changes we make (i.e., files we create or edit) are ones that we want to push to our remote GitHub repository.\n", "\n", "B. It allows us to edit multiple files at once, but associate particular commit messages with particular files (so that the commit messages can more specifically reflect the changes that were made).\n", "\n", "C. This is technically required of all version control software.\n", "\n", "D. A and C.\n", "\n", "E. A and B.\n", "\n", "*Assign your answer to an object called `answer6.1`. Make sure your answer is an uppercase letter and is surrounded by quotation marks (e.g. `\"F\"`).* " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "nbgrader": { "cell_type": "code", "checksum": "38a3f673132da239f709e5d9c8fb3e00", "grade": false, "grade_id": "cell-78a41a64da6293e8", "locked": false, "schema_version": 3, "solution": true, "task": false } }, "outputs": [], "source": [ "# Replace the fail() with your answer. \n", "\n", "# your code here\n", "fail() # No Answer - remove if you provide an answer" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "code", "checksum": "a48e7b74da055291ccb8cea628861b7b", "grade": true, "grade_id": "cell-4df7797ab4b028cf", "locked": true, "points": 1, "schema_version": 3, "solution": false, "task": false } }, "outputs": [], "source": [ "test_6.1()" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "1e98fdcad231835a9eaf2b60a5b309bd", "grade": false, "grade_id": "cell-4e608fec626c6457", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "source": [ "## 7. Making the commit \n", "\n", "The next step is to **commit** our changes to our local Git repository. You can use the Jupyter Git extension to do this now. **This task corresponds to [this step](https://datasciencebook.ca/version-control.html#making-the-commit) in the textbook.**" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "bd76b3201ac26e49e146d329c0284fe1", "grade": false, "grade_id": "cell-bb0b5573ca79e68e", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "source": [ "**Question 7.1** True or false:\n", "
{points: 1}\n", "\n", "When we **commit** our changes to Git, the snapshot of changes, the commit message, the time and date stamp and the user who committed the changes are all saved to the Git history on GitHub.\n", "\n", "*Assign your answer to an object called `answer7.1`. Make sure your answer is written in lowercase and is surrounded by quotation marks (e.g. `\"true\"` or `\"false\"`).* " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "nbgrader": { "cell_type": "code", "checksum": "b017f4ad6dfdeae3628d15e5a7f636aa", "grade": false, "grade_id": "cell-abcee8a2afc5bc19", "locked": false, "schema_version": 3, "solution": true, "task": false } }, "outputs": [], "source": [ "# Replace the fail() with your answer. \n", "\n", "# your code here\n", "fail() # No Answer - remove if you provide an answer" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "code", "checksum": "3b7f4b330e3965be85a736466e4bf9fc", "grade": true, "grade_id": "cell-a4297f9a9b8fe5a9", "locked": true, "points": 1, "schema_version": 3, "solution": false, "task": false } }, "outputs": [], "source": [ "test_7.1()" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "a0d9d752ff76ffb730ff3a6a5cfb3ad7", "grade": false, "grade_id": "cell-76bb7245f8522013", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "source": [ "## 8. Pushing the commits to GitHub\n", "\n", "Finally, we are ready to send our changes (creating and adding code to `marg_vs_divorce_viz.ipynb`) to our remote repository through a process we call \"pushing\". Go ahead and do this now. **This task corresponds to [this step](https://datasciencebook.ca/version-control.html#pushing-the-commits-to-github) in the textbook.**\n", "\n", "After completing pushing your work to the remote repository on GitHub, visit your repository on GitHub.com and check out what your awesome toy project looks like!" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "33d8de6772e90aebf60f3dfb5df600d9", "grade": false, "grade_id": "cell-22a610ed6a316a7b", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "source": [ "**Question 8.1** Multiple Choice:\n", "\n", "Which statement below is **not** true?\n", "
{points: 1}\n", "\n", "A. Cloning and pulling a GitHub repository are the exact same thing.\n", "\n", "B. Pushing with Git is the act of sending changes that were committed to Git to a remote repository, for example, on GitHub.com.\n", "\n", "C. Pulling with Git is the act of collecting changes that exists in a remote repository, for example, on GitHub.com, that do not yet exist on the local computer you are working on (i.e., your workspace on the JupyterHub or your laptop).\n", "\n", "D. You should push your work to GitHub anytime you want to share your work with others, or when you are done a work session and want to back up your work.\n", "\n", "*Assign your answer to an object called `answer8.1`. Make sure your answer is an uppercase letter and is surrounded by quotation marks (e.g. `\"F\"`).* " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "nbgrader": { "cell_type": "code", "checksum": "fab864ef56e6b19df2e769bd7ff667c4", "grade": false, "grade_id": "cell-513a65b2e4fa6c01", "locked": false, "schema_version": 3, "solution": true, "task": false } }, "outputs": [], "source": [ "# Replace the fail() with your answer. \n", "\n", "# your code here\n", "fail() # No Answer - remove if you provide an answer" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "code", "checksum": "62274d743d128e8fc8e9657172c01a8f", "grade": true, "grade_id": "cell-ac98c61c35f6f0b6", "locked": true, "points": 1, "schema_version": 3, "solution": false, "task": false } }, "outputs": [], "source": [ "test_8.1()" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "b2334f3b098cd2643631c241d53a09b9", "grade": false, "grade_id": "cell-f5d9167c9c55eb6f", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "source": [ "## 9. Giving collaborators access to your project\n", "\n", "One of the advantages of using version control tools, such as Git and GitHub, is how it lets you collaborate. Let's get some practice starting down this path. Add one or more of your group members to your GitHub repository as a collaborator. **This task corresponds to [this step](https://datasciencebook.ca/version-control.html#giving-collaborators-access-to-your-project) in the textbook.**" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "16000ed4f9c07ae9679d4e6e8804cfb3", "grade": false, "grade_id": "cell-f2819a276d866112", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "source": [ "**Question 9.1** True or false:\n", "
{points: 1}\n", "\n", "You can clone or pull from any public remote repository on GitHub.com, however you can only push to public remote repositories on GitHub.com that you own are a collaborator on.\n", "\n", "*Assign your answer to an object called `answer9.1`. Make sure your answer is written in lowercase and is surrounded by quotation marks (e.g. `\"true\"` or `\"false\"`).* " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "nbgrader": { "cell_type": "code", "checksum": "ed1684b0eb6f683b04ec3f67d2d9d40f", "grade": false, "grade_id": "cell-e27a72ed06d0a5c6", "locked": false, "schema_version": 3, "solution": true, "task": false } }, "outputs": [], "source": [ "# Replace the fail() with your answer. \n", "\n", "# your code here\n", "fail() # No Answer - remove if you provide an answer" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "code", "checksum": "13eba7e0647284e25fda17855a46aaa7", "grade": true, "grade_id": "cell-9dc8d28efb9ccda7", "locked": true, "points": 1, "schema_version": 3, "solution": false, "task": false } }, "outputs": [], "source": [ "test_9.1()" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "99815a4a33c74c42a7ddd30a03a5691f", "grade": false, "grade_id": "cell-797a55d8f7192735", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "source": [ "### (Optional) more collaboration practice!\n", "\n", "If you want to practice more Git & GitHub skills for collaboration, ask someone in your room if you can collaborate and send an edit to their project. To do this, they will need to add you as a collaborator, and then you will need to clone their repository to your JupyterHub. After that, you can edit some files (or create a whole new one), save your work, and then use the Jupyter Git extension to add, commit, and push your changes to their remote GitHub repository." ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "d959a4946c8d33eddb1e771c32e855c4", "grade": false, "grade_id": "cell-2f3cb25ea183fa20", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "source": [ "## 10. Communicating using GitHub issues\n", "\n", "It's easy for project communications to get lost in email or whatever messaging platform you use to communicate with your team. GitHub issues are an excellent tool explicitly designed for project collaboration as they are \"attached\" to the project's remote GitHub repository. Your task here is to go to the issue tab for your project and create an issue about something you might want to improve about your project. **This task corresponds to [this step](https://datasciencebook.ca/version-control.html#communicating-using-github-issues) in the textbook.**" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "5afd44d94f09905f4b3071ca3331163e", "grade": false, "grade_id": "cell-9df9861dc7f0b061", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "source": [ "**Question 10.1** Multiple Choice:\n", "
{points: 1}\n", "\n", "Which statement below is **not** a reason why GitHub issues are an ideal medium for project-specific communications?\n", "\n", "A. Issues are part of each GitHub repository, and thus \"attached\" to the project.\n", "\n", "B. Issues only persist while they are open, and immediately deleted when they are closed.\n", "\n", "C. Issues are easily searchable using GitHub’s search tools.\n", "\n", "D. All issues are accessible to all project collaborators, so no one is left out of the conversation.\n", "\n", "E. Issues can be set up so that team members get email notifications when a new issue is created or a new post is made in an issue thread.\n", "\n", "*Assign your answer to an object called `answer10.1`. Make sure your answer is an uppercase letter and is surrounded by quotation marks (e.g. `\"F\"`).* " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "nbgrader": { "cell_type": "code", "checksum": "8947c4f7b1636928974ce594a5da002a", "grade": false, "grade_id": "cell-79a4febe0e471e05", "locked": false, "schema_version": 3, "solution": true, "task": false } }, "outputs": [], "source": [ "# Replace the fail() with your answer. \n", "\n", "# your code here\n", "fail() # No Answer - remove if you provide an answer" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "code", "checksum": "9bbeeb698eaf46a4543516f3c75dfbce", "grade": true, "grade_id": "cell-6656677ba896c92f", "locked": true, "points": 1, "schema_version": 3, "solution": false, "task": false } }, "outputs": [], "source": [ "test_10.1()" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "3759ce350d4ee108d4ec759fbe5b8980", "grade": false, "grade_id": "cell-38a8620df69dd63c", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "source": [ "### (Optional) Even more collaboration practice! \n", "\n", "Visit a group member's GitHub repository and leave a polite but constructive message on how they could improve their project. \n" ] }, { "cell_type": "markdown", "metadata": { "deletable": false, "editable": false, "nbgrader": { "cell_type": "markdown", "checksum": "63a79938d9b762f2dc3e3a144338a0ca", "grade": false, "grade_id": "cell-86e7938376066291", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "source": [ "## Nice work! You're all done here!\n", "\n", "" ] } ], "metadata": { "kernelspec": { "display_name": "R", "language": "R", "name": "ir" }, "language_info": { "codemirror_mode": "r", "file_extension": ".r", "mimetype": "text/x-r-source", "name": "R", "pygments_lexer": "r", "version": "4.3.1" } }, "nbformat": 4, "nbformat_minor": 4 }