Skip to content

Commit 5b3d528

Browse files
copyedit version control edits
1 parent c22ffd2 commit 5b3d528

File tree

1 file changed

+40
-40
lines changed

1 file changed

+40
-40
lines changed

version-control.Rmd

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@ we will cover the Jupyter Git interface.
3333

3434
## Chapter learning objectives
3535

36-
By the end of the chapter, readers will be able to:
37-
38-
- Describe what version control is and why data analysis projects can benefit from it
39-
- Create a remote version control repository on GitHub
40-
- use Jupyter's Git version control tools for project versioning and collaboration:
41-
- clone a remote version control repository to create a local repository
42-
- commit changes to a local version control repository
43-
- push local changes to a remote version control repository
44-
- pull changes from a remote version control repository to a local version control repository
45-
- resolve merge conflicts
46-
- Give collaborators access to a remote GitHub repository
47-
- Communicate with collaborators using GitHub issues
48-
- Use best practices when collaborating on a project with others
36+
By the end of the chapter, readers will be able to do the following:
37+
38+
- Describe what version control is and why data analysis projects can benefit from it.
39+
- Create a remote version control repository on GitHub.
40+
- Use Jupyter's Git version control tools for project versioning and collaboration:
41+
- Clone a remote version control repository to create a local repository.
42+
- Commit changes to a local version control repository.
43+
- Push local changes to a remote version control repository.
44+
- Pull changes from a remote version control repository to a local version control repository.
45+
- Resolve merge conflicts.
46+
- Give collaborators access to a remote GitHub repository.
47+
- Communicate with collaborators using GitHub issues.
48+
- Use best practices when collaborating on a project with others.
4949

5050
## What is version control, and why should I use it?
5151

@@ -57,7 +57,7 @@ made to the analysis, projects tend to become messy.
5757
This mess can have serious, negative repercussions on an analysis project,
5858
including interesting results files that your code cannot reproduce,
5959
temporary files with snippets of ideas that are forgotten or
60-
not easy to find, mind-boggling filenames that make it unclear which is
60+
not easy to find, mind-boggling file names that make it unclear which is
6161
the current working version of the file (e.g., `document_final_draft_final.txt`,
6262
`to_hand_in_final_v2.txt`, etc.), and more.
6363

@@ -66,7 +66,7 @@ means that most of the time, the final version of the analysis that is
6666
shared with the audience is only a fraction of what was explored during
6767
the development of that analysis.
6868
Changes in data visualizations and modeling approaches,
69-
as well as some negative results are often not observable from
69+
as well as some negative results, are often not observable from
7070
reviewing only the final, polished analysis.
7171
The lack of observability of these parts of the analysis development
7272
can lead to others repeating things that did not work well,
@@ -107,16 +107,16 @@ discuss issues and bugs, and distribute your final product.
107107
For both of these items, there is a wide variety of choices.
108108
In this textbook we'll use Git for version control,
109109
and GitHub for repository hosting,
110-
because both are currently the most widely-used platforms.
110+
because both are currently the most widely used platforms.
111111
In the
112-
[additional resources section at the end of the chapter](vc-add-res)
112+
additional resources section at the end of the chapter,
113113
we list many of the common version control systems
114114
and repository hosting services in use today.
115115

116116
> **Note:** Technically you don't *have to* use a repository hosting service.
117117
> You can, for example, version control a project
118-
> that is stored only in a folder on your computer -
119-
> never sharing it on a repository hosting service.
118+
> that is stored only in a folder on your computer—never
119+
> sharing it on a repository hosting service.
120120
> But using a repository hosting service provides a few big benefits,
121121
> including managing collaborator access permissions,
122122
> tools to discuss and track bugs,
@@ -128,7 +128,7 @@ and repository hosting services in use today.
128128
129129
## Version control repositories
130130

131-
Typically when we put a data analysis project under version control,
131+
Typically, when we put a data analysis project under version control,
132132
we create two copies of the repository \index{repository} (Figure \@ref(fig:vc1-no-changes)).
133133
One copy we use as our primary workspace where we create, edit, and delete files.
134134
This copy is commonly referred to as \index{repository!local} the **local repository**. The local
@@ -154,7 +154,7 @@ a version of the project. These records are \index{git!commit} called **commits
154154
are a snapshot of the file contents as well
155155
metadata about the repository at that time the record was created (who made the
156156
commit, when it was made, etc.). In the local and remote repositories shown in
157-
Figure \@ref(fig:vc1-no-changes), there are two commits represented as grey
157+
Figure \@ref(fig:vc1-no-changes), there are two commits represented as gray
158158
circles. Each commit can be identified by a
159159
human-readable **message**, which you write when you make a commit, and a
160160
**commit hash** that Git automatically adds for you.
@@ -177,7 +177,7 @@ two of these shortened hashes, one for each commit: `Daa29d6` and `884c7ce`.
177177

178178
## Version control workflows
179179

180-
When you work in a local version controlled repository, there are generally three additional
180+
When you work in a local version-controlled repository, there are generally three additional
181181
steps you must take as part of your regular workflow. In addition to
182182
just working on files—creating,
183183
editing, and deleting files as you normally would—you must:
@@ -240,7 +240,7 @@ you need \index{git!push} to **push** (i.e., send) those commits back to GitHub
240240
the history in the remote repository (i.e., GitHub) to match what you have in your
241241
local repository. Now when collaborators interact with the remote repository, they will be able
242242
to see the changes you made. And you can also take comfort in the fact that your work is now backed
243-
up on the cloud!
243+
up in the cloud!
244244

245245
```{r vc5-push, fig.cap = 'Pushing the commit to send the changes to the remote repository on GitHub.', fig.retina = 2, out.width="100%"}
246246
image_read("img/vc5-push.png") |>
@@ -306,8 +306,8 @@ Before you can create remote repositories on GitHub,
306306
you will need a GitHub account; you can sign up for a free account
307307
at [https://github.com/](https://github.com/).
308308
Once you have logged into your account, you can create a new repository to host
309-
your project by clicking on the "+" icon in the upper right
310-
hand corner, and then on "New Repository," as shown in
309+
your project by clicking on the "+" icon in the upper right-hand
310+
corner, and then on "New Repository," as shown in
311311
Figure \@ref(fig:new-repository-01).
312312

313313
(ref:new-repository-01) New repositories on GitHub can be created by clicking on "New Repository" from the + menu.
@@ -319,7 +319,7 @@ image_read("img/version_control/new_repository_01.png") |>
319319
image_flop()
320320
```
321321

322-
Repositories can be setup with a variety of configurations, including a name,
322+
Repositories can be set up with a variety of configurations, including a name,
323323
optional description, and the inclusion (or not) of several template files.
324324
One of the most important configuration items to choose is the visibility to the outside world,
325325
either public or private. *Public* repositories \index{repository!public} can be viewed by anyone.
@@ -330,7 +330,7 @@ To get started with a *public* repository having a template `README.md` file, ta
330330
following steps shown in Figure \@ref(fig:new-repository-02):
331331

332332
1. Enter the name of your project repository. In the example below, we use `canadian_languages`. Most repositories follow a similar naming convention involving only lowercase letter words separated by either underscores or hyphens.
333-
2. Choose an option for the privacy of your repository
333+
2. Choose an option for the privacy of your repository.
334334
3. Select "Add a README file." This creates a template `README.md` file in your repository's root folder.
335335
4. When you are happy with your repository name and configuration, click on the green "Create Repository" button.
336336

@@ -355,7 +355,7 @@ image_read("img/version_control/new_repository_03.png") |>
355355
### Editing files on GitHub with the pen tool
356356

357357
The pen tool \index{GitHub!pen tool} can be used to edit existing plain text files. When you click on
358-
the pen tool the file will be opened in a text box where you can use your
358+
the pen tool, the file will be opened in a text box where you can use your
359359
keyboard to make changes (Figures \@ref(fig:pen-tool-01) and \@ref(fig:pen-tool-02)).
360360

361361
```{r pen-tool-01, fig.cap = 'Clicking on the pen tool opens a text box for editing plain text files.', fig.retina = 2, out.width="100%"}
@@ -399,8 +399,8 @@ image_read("img/version_control/pen-tool_03.png") |>
399399
### Creating files on GitHub with the "Add file" menu
400400

401401
The "Add file" menu \index{GitHub!add file} can be used to create new plain text files and upload files
402-
from your computer. To create a new plain text file, click the "Add file" drop
403-
down menu and select the "Create new file" option
402+
from your computer. To create a new plain text file, click the "Add file"
403+
drop-down menu and select the "Create new file" option
404404
(Figure \@ref(fig:create-new-file-01)).
405405

406406
```{r create-new-file-01, fig.cap = 'New plain text files can be created directly on GitHub.', fig.retina = 2, out.width="100%"}
@@ -420,7 +420,7 @@ Note that GitHub understands and renders `.md` files \index{markdown} using a
420420
very similar to Jupyter notebooks, so the "Preview" tab is especially helpful
421421
for checking markdown code correctness.
422422

423-
```{r create-new-file-02, fig.cap = 'New plain text files require a filename in the text box circled in red, and file content entered in the larger text box (red arrow).', fig.retina = 2, out.width="100%"}
423+
```{r create-new-file-02, fig.cap = 'New plain text files require a file name in the text box circled in red, and file content entered in the larger text box (red arrow).', fig.retina = 2, out.width="100%"}
424424
image_read("img/version_control/create-new-file_02.png") |>
425425
image_flop() |>
426426
image_crop("3584x1300") |>
@@ -436,10 +436,10 @@ image_read("img/version_control/create-new-file_03.png") |>
436436
```
437437

438438
You can also upload files that you have created on your local machine by using
439-
the "Add file" drop down menu and selecting "Upload files"
439+
the "Add file" drop-down menu and selecting "Upload files"
440440
(Figure \@ref(fig:upload-files-01)).
441441
To select the files from your local computer to upload, you can either drag and
442-
drop them into the grey box area shown below, or click the "choose your files"
442+
drop them into the gray box area shown below, or click the "choose your files"
443443
link to access a file browser dialog. Once the files you want to upload have
444444
been selected, click the green "Commit changes" button at the bottom of the
445445
page (Figure \@ref(fig:upload-files-02)).
@@ -548,11 +548,11 @@ image_read("img/generate-pat_03.png")
548548
Now that we have everything we need for authentication,
549549
the next step is to *clone* the \index{git!clone} remote repository on GitHub
550550
to create a local repository, i.e., make a
551-
copy that knows where it was obtained from so that it knows where send/receive
551+
copy that knows where it was obtained from so that it knows where to send/receive
552552
new committed edits. In order to do this, first copy the URL from the HTTPS tab
553-
of the Code drop down menu on GitHub (Figure \@ref(fig:clone-02)).
553+
of the Code drop-down menu on GitHub (Figure \@ref(fig:clone-02)).
554554

555-
(ref:clone-02) The remote address (URL) corresponding to the location of the remote GitHub repository can be found in the green "Code" drop down menu.
555+
(ref:clone-02) The remote address (URL) corresponding to the location of the remote GitHub repository can be found in the green "Code" drop-down menu.
556556

557557
```{r clone-02, fig.cap = '(ref:clone-02)', fig.retina = 2, out.width="100%"}
558558
image_read("img/version_control/clone_02.png") |>
@@ -743,7 +743,7 @@ image_read("img/version_control/add_collab_05.png") |>
743743
image_crop("3584x1250")
744744
```
745745

746-
After this you should see your newly added collaborator listed under the
746+
After this, you should see your newly added collaborator listed under the
747747
"Manage access" tab. They should receive an email invitation to join the
748748
GitHub repository as a collaborator. They need to accept this invitation
749749
to enable write access.
@@ -835,7 +835,7 @@ The beginning of the merge
835835
conflict is preceded by `<<<<<<< HEAD` and the end of the merge conflict is
836836
marked by `>>>>>>>`. Between these markings, Git also inserts a separator
837837
(`=======`). The version of the change before the separator is your change, and
838-
the version that follows the separator was the change that existed on GitHub
838+
the version that follows the separator was the change that existed on GitHub.
839839
In Figure \@ref(fig:merge-conflict-05), you can see that in your local repository
840840
there is a line of code that calls `scale_color_manual` with three color values (`deeppink2`, `cyan4`, and `purple1`).
841841
It looks like your collaborator made an edit to that line too, except with different colors (to `blue3`, `red3`, and `black`)!
@@ -873,7 +873,7 @@ GitHub page, and they persist there even after the conversation is over and the
873873
contrast to email, issues are not usually deleted). One issue thread is usually created
874874
per topic, and they are easily searchable using GitHub's search tools. All
875875
issues are accessible to all project collaborators, so no one is left out of
876-
the conversation. Finally, issues can be setup so that team members get email
876+
the conversation. Finally, issues can be set up so that team members get email
877877
notifications when a new issue is created or a new post is made in an issue
878878
thread. Replying to issues from email is also possible. Given all of these advantages,
879879
we highly recommend the use of issues for project-related communication.
@@ -898,7 +898,7 @@ image_read("img/version_control/issue_02.png") |>
898898
```
899899

900900
Add an issue title (which acts like an email subject line), and then put the
901-
body of the message in the larger text box. Finally click "Submit new issue"
901+
body of the message in the larger text box. Finally, click "Submit new issue"
902902
to post the issue to share with others (Figure \@ref(fig:issue-03)).
903903

904904
```{r issue-03, fig.cap = 'Dialog boxes and submission button for creating new GitHub issues.', fig.retina = 2, out.width="100%"}

0 commit comments

Comments
 (0)