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
including "Global Information Tacker" for when "you're in a good mood".
86
+
79
87
For those interested, The Carpentries has a [Version Control with Mercurial](https://swcarpentry.github.io/hg-novice/) lesson (2013-2018), which provides additional context and historical perspective.
Copy file name to clipboardExpand all lines: 07-github.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -168,6 +168,36 @@ ls: cannot access '/c/Users/Alfredo/.ssh': No such file or directory
168
168
If SSH has been set up on the computer you're using, the public and private key pairs will be listed. The file names are either `id_ed25519`/`id_ed25519.pub` or `id_rsa`/`id_rsa.pub` depending on how the key pairs were set up.
169
169
Since they don't exist on Alfredo's computer, he uses this command to create them.
170
170
171
+
::::::::::::::::::::::::::::::::::::::::: spoiler
172
+
173
+
## Resolving SSH Key Conflicts: Custom Names and Paths
174
+
175
+
If you need to create an SSH key pair with a custom name or store it in a non-default location (e.g., because a default-named key like id_ed25519 already exists), Git may not automatically use it when pushing or pulling from GitHub.
176
+
177
+
One solution is to add a GitHub entry to your SSH config.
178
+
179
+
Open or create the SSH config file:
180
+
181
+
```bash
182
+
183
+
$ nano ~/.ssh/config
184
+
```
185
+
186
+
Add an entry for GitHub, replacing the path with your key’s actual name and location:
To create an SSH key pair Alfredo uses this command, where the `-t` option specifies which type of algorithm to use and `-C` attaches a comment to the key (here, Alfredo's email):
Copy file name to clipboardExpand all lines: 10-open.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -139,7 +139,7 @@ approach for your current project and explain why.
139
139
140
140
### Useful Resource
141
141
Confused by the sheer number of different repositories you could choose for your data?
142
-
This [repository selection flowchart](https://zenodo.org/records/11105430) aims to "guide users through a series of considerations for slecting the right repository for sharing data."
142
+
This [repository selection flowchart](https://zenodo.org/records/11105430) aims to "guide users through a series of considerations for selecting the right repository for sharing data."
Copy file name to clipboardExpand all lines: 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