@@ -24,17 +24,18 @@ own changes in the next episode.
2424
2525## GitHub, VS Code, Command line, and more
2626
27- We offer ** three different paths** for this exercise:
27+ We offer ** four different paths** for this exercise:
2828- ** GitHub** (this is the one we will demonstrate on day 1)
2929- ** VS Code** (if you prefer to follow along using an editor; we will
3030 return to this on day 2)
31+ - ** RStudio** (if you prefer to follow along using an editor; we will
32+ return to this on day 2)
3133- ** Command line** (for people comfortable with the command line; you
3234 will see more of this on day 2)
3335
34- In the future we'll add more paths, for example Jupyter and RStudio
36+ In the future we'll add more paths, for example Jupyter
3537([ contributions welcome!] ( https://github.com/coderefinery/git-intro/issues/458 ) ).
3638
37-
3839## Creating a copy of the repository by "forking"
3940
4041A {term}` repository ` is a collection of files in one directory tracked
@@ -66,7 +67,7 @@ become important later, when we make our own changes.
66671 . You should shortly be redirected to your copy of the repository
6768 ** USER/recipe-book** .
6869
69- At all times you should be aware of if you looking at * your* repository
70+ At all times you should be aware of if you are looking at * your* repository
7071or the * CodeRefinery {term}` upstream ` * repository.
7172* Your repository: https://github.com/**USER**/recipe-book
7273* CodeRefinery upstream repository: https://github.com/**cr-workshop-exercises**/recipe-book
@@ -115,6 +116,22 @@ need to have forked the repository as described above.
115116 HTTPS, depending on your setup.
1161171 . Change to that directory: ` cd recipe-book `
117118::::
119+
120+ ::::{group-tab} RStudio
121+ You need to have forked the repository as described above.
122+
123+ We need to start by making a copy of this repository locally.
124+
125+ 1 . Start RStudio.
126+ 1 . Go to "File" → "New Project..."
127+ 1 . Choose "Version Control", and then "Git"
128+ 1 . In the "Repository URL" field, paste in this URL: ` https://github.com/USER/recipe-book ` , where
129+ ` USER ` is your username. You can copy this from the browser.
130+ 1 . You can change the "Project directory name" if you want but that is not mandatory.
131+ By default, it will use the repository name from the URL.
132+ 1 . Click "Create Project"
133+ ::::
134+
118135:::::
119136
120137
@@ -204,6 +221,16 @@ $ git log --oneline
204221```
205222::::
206223
224+ ::::{group-tab} RStudio
225+ This can be done from "History", in the top right panel of explorer. This will open a pop-up window
226+ from which you can explore the history of commits.
227+ :::{figure} img/browsing/history_RStudio.png
228+ :alt: Screenshot of RStudio of where to find the commit history
229+ :width: 100%
230+ :class: with-border
231+ :::
232+ ::::
233+
207234:::::
208235
209236
@@ -240,8 +267,20 @@ $ git graph
240267If not, you can use the basic command:
241268``` console
242269$ git log --graph --oneline --decorate --all
270+ ```
243271::::
244272
273+ ::::{group-tab} RStudio
274+ This can be viewed in the same "History" tab that we just looked at. The branch network can be seen on the left of
275+ the commit list, and individual commits can be clicked to see the person who committed and what changes they did.
276+
277+ :::{figure} img/browsing/network_RStudio.png
278+ :alt: Screenshot of RStudio of where to find the commit history
279+ :width:100%
280+ :class: with-border
281+ :::
282+
283+ ::::
245284:::::
246285
247286
@@ -276,6 +315,25 @@ $ git log sides/guacamole.md
276315```
277316::::
278317
318+ ::::{group-tab} RStudio
319+ Open the file in the main editor window, and navigate to the "Version control" menu (Git icon in the toolbar right
320+ below the main menu bar), then select "Log of guacamole.md"
321+ :::{figure} img/browsing/file-history_RStudio_menu.png
322+ :alt: Screenshot of RStudio of where to find the file history
323+ :width: 100%
324+ :class: with-border
325+ :::
326+
327+ This will open a pop-up window showing all commits that modified the "Guacamole.md" file.
328+
329+ :::{figure} img/browsing/file-history_RStudio_view.png
330+ :alt: Screenshot of RStudio showing history of the guacamole.md file
331+ :width: 100%
332+ :class: with-border
333+ :::
334+
335+ ::::
336+
279337:::::
280338
281339
@@ -325,6 +383,18 @@ $ git grep -i salt # case insensitive
325383```
326384::::
327385
386+ ::::{group-tab} RStudio
387+ Go to Edit → Find in Files... (ctrl+shift+F) and type salt in the Find field. It will by default search for salt in
388+ all files in the recipe-book directory. Press Find button at the bottom of the pop-up window. It will show all
389+ occurrences in every file in a Find in Files tab in the Console panel.
390+
391+ :::{figure} img/browsing/search_RStudio.png
392+ :alt: Screenshot of the Find in Files tab in RStudio showing all "salt" occurrences in every file
393+ :width: 100%
394+ :class: with-border
395+ :::
396+ ::::
397+
328398:::::
329399
330400
@@ -359,6 +429,17 @@ $ git blame sides/guacamole.md
359429```
360430::::
361431
432+ ::::{group-tab} RStudio
433+ Open the file in the main editor window, and navigate to the "Version control" menu (Git icon in the toolbar right
434+ below the main menu bar), then select "Blame "guacamole.md" on GitHub". This will open a GitHub page in your
435+ web-browser with the same view as shown in the GitHub tab.
436+ :::{figure} img/browsing/annotate_RStudio.png
437+ :alt: Screenshot of RStudio of where to find the file history
438+ :width: 100%
439+ :class: with-border
440+ :::
441+ ::::
442+
362443:::::
363444
364445
0 commit comments