You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -403,7 +414,7 @@ Note that GitHub understands and renders `.md` files using a
403
414
very similar to Jupyter notebooks, so the "Preview" tab is especially helpful
404
415
for checking markdown code correctness.
405
416
406
-
```{r create-new-file-02, fig.cap = 'New plain text files require a filename be inputted in the textbox circled in red, and file content entered in the larger text box (red arrow).', fig.retina = 2}
417
+
```{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}
To select the files from your local computer to upload, you can either drag and
433
-
drop them into the grey box area shown below, or click the "choose your files"
434
-
link to access a file browser dialog. Once the files you want to upload have
435
-
been selected, click the green "Commit changes" button at the bottom of the
436
-
page (Figure \@ref(fig:upload-files-02)).
437
-
438
-
```{r upload-files-02, fig.cap = 'Uploaded files can specified by dragging them into the GitHub website where specified (red circle) or by clicking on the "choose your files" to select them via a file browser. Uploaded files are also required to be committed along with an associated commit message.', fig.retina = 2}
448
+
```{r upload-files-02, fig.cap = 'Specify files to upload by dragging them into the GitHub website (red circle) or by clicking on "choose your files." Uploaded files are also required to be committed along with an associated commit message.', fig.retina = 2}
Note that Git and GitHub are designed to track changes in individual files.
446
-
*Do not* upload your whole project in an archive file (e.g. `.zip`). If you do,
447
-
then Git can only keep track of changes to the entire `.zip` file---that
448
-
wouldn't be very useful if you're trying to see the history of changes to a
449
-
single code file in your project!
450
-
456
+
**Do not** upload your whole project in an archive file (e.g. `.zip`). If you do,
457
+
then Git can only keep track of changes to the entire `.zip` file, which will not
458
+
be human-readable. Committing one big archive defeats the whole purpose of using
459
+
version control: you won't be able to see, interpret, or find changes in the history
460
+
of any of the actual content of your project!
451
461
452
462
## Working with local repositories using Jupyter {#local-repo-jupyter}
453
-
454
-
### Cloning a repository using Jupyter
455
-
456
-
Although there are several ways to create and edit files on
457
-
GitHub, they are not quite powerful enough for
458
-
efficiently creating and editing complex files, or files that need to be
459
-
executed to assess whether they work (e.g., files containing code).
460
-
For example,
461
-
you wouldn't be able to run analysis written with R code directly on GitHub.
462
-
Thus, it is useful to be able to connect the project repository
463
-
that was created on GitHub to a coding environment.
464
-
This can be done using the Git.
465
-
Git can be run via several different ways,
466
-
below we show how to do this using the Jupyter Git extension.
467
-
The Jupyter Git extension can be run via Jupyter on your local computer,
468
-
or on a JupyterHub server.
463
+
Although there are several ways to create and edit files on GitHub, they are
464
+
not quite powerful enough for efficiently creating and editing complex files,
465
+
or files that need to be executed to assess whether they work (e.g., files
466
+
containing code). For example, you wouldn't be able to run analysis written
467
+
with R code directly on GitHub. Thus, it is useful to be able to connect the
468
+
remote repository that was created on GitHub to a local coding environment. This
469
+
can be done by creating and working in a local copy of the repository.
470
+
In this chapter, we focus on interacting with Git via Jupyter using
471
+
the Jupyter Git extension. The Jupyter Git extension
472
+
can be run via Jupyter on your local computer, or on a JupyterHub server.
469
473
*Note: we recommend reading Chapter \@ref(getting-started-with-jupyter)*
470
474
*to learn how to use Jupyter before reading this chapter.*
471
475
472
-
We need to *clone* our project's Git repository to our local computer
473
-
or JupyterHub server---i.e., make a
476
+
### Cloning a repository using Jupyter
477
+
478
+
The first step is to *clone* the remote repository on GitHub to create a local repository,
479
+
i.e., make a
474
480
copy that knows where it was obtained from so that it knows where send/receive
475
481
new committed edits. In order to do this, first copy the URL from the HTTPS tab
476
482
of the Code drop down menu on GitHub (Figure \@ref(fig:clone-02)).
477
483
478
-
```{r clone-02, fig.cap = 'The remote address (URL) corresponding to the location of the GitHub repository needed to clone it to a computer can be found under the green "Code" button.', fig.retina = 2}
484
+
```{r clone-02, fig.cap = 'The remote address (URL) corresponding to the location of the remote GitHub repository can be found in the green "Code" drop down menu.', fig.retina = 2}
To snapshot the changes with an associated commit message,
562
-
we put the message in the text box at the bottom of the Git pane
556
+
we put a message in the text box at the bottom of the Git pane
563
557
and click on the blue "Commit" button (Figure \@ref(fig:git-commit-01)).
564
558
It is highly recommended to write useful and meaningful messages about what
565
559
was changed. These commit messages, and the datetime stamp for a given
566
560
commit, are the primary means to navigate through the project's history in the
567
561
event that we need to view or retrieve a past version of a file, or
568
562
revert our project to an earlier state.
563
+
When you click the "Commit" button for the first time, you will be prompted to
564
+
enter your name and email. This only needs to be done once for each machine
565
+
you use Git on.
569
566
570
567
```{r git-commit-01, fig.cap = 'A commit message must be added into the Jupyter Git extension commit text box before the blue Commit button can be used to record the commit.', fig.retina = 2}
0 commit comments