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
Copy file name to clipboardExpand all lines: episodes/14-supplemental-rstudio.md
+14-27Lines changed: 14 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,46 +133,33 @@ would tell us:
133
133
134
134
{alt='RStudio screenshot showing the "Review Changes" dialog after pressing the "History" button. The top panel lists the commits in the repository, similar to git log. The bottom panel shows the changes included in the commit that has been selected in the top panel.'}
135
135
136
-
RStudio creates a number of files that it uses to keep track of a project. We
137
-
often don't want to track these, in which case we add them to our `.gitignore`
138
-
file:
136
+
Now that you've confirmed your commit history locally using the Git pane in RStudio, you can head over to GitHub to see the same history reflected in your repository online.
139
137
140
-
{alt='RStudio screenshot showing .gitignore open in the editor pane with the files .Rproj.user, .Rhistory, .RData, and \*.Rproj added to the end'}
141
-
142
-
::::::::::::::::::::::::::::::::::::::::: callout
143
-
144
-
## Tip: versioning disposable output
145
-
146
-
Generally you do not want to version control disposable output (or read-only
147
-
data). You should modify the `.gitignore` file to tell Git to ignore these
148
-
files and directories.
138
+
To view it, go to your repository page and click on the "Commits" link near the top.
149
139
140
+
{alt='GitHub screenshot showing where to find the commit history button.'}
1. Create a new directory within your project called `graphs`.
158
-
2. Modify the `.gitignore` so that the `graphs` directory is not version controlled.
146
+
After seeing how your commit history appears on GitHub, you can be confident that your changes have been successfully pushed and recorded.
159
147
160
-
::::::::::::::: solution
148
+
Next, let’s take a look at how RStudio quietly helps manage your repository by automatically updating the `.gitignore` file.
161
149
162
-
## Solution to Challenge
150
+
When you create a *New Project* in RStudio, it generates an *.Rproj file and a hidden folder called `.Rproj.user`. These are used to store project-specific settings and user preferences.
163
151
164
-
This can be done in Rstudio:
152
+
RStudio recognizes that these files typically shouldn’t be tracked in version control, so it automatically adds `.Rproj.user` to your existing `.gitignore` file.
165
153
166
-
```r
167
-
dir.create("./graphs")
168
-
```
154
+
Notice that the `.gitignore` file was modified and appears as a changed file in the Git tab on the right-hand side panel.
169
155
170
-
Then open up the `.gitignore` file from the right-hand panel of Rstudio and add
171
-
`graphs/` to the list of files to ignore.
156
+
{alt='RStudio screenshot showing .gitignore open in the editor pane with the .Rproj.user folder added to the end.'}
172
157
158
+
::::::::::::::::::::::::::::::::::::::: challenge
173
159
160
+
## Push the .gitignore changes to GitHub
174
161
175
-
:::::::::::::::::::::::::
162
+
Consider adding other files to be ignored, such as recipes.Rproj, .Rhistory and .RData, and complete the process for saving RStudio's `.gitignore` file changes to your remote repository.
0 commit comments