@@ -46,7 +46,7 @@ Illustration of what we want to achieve in this exercise.
4646:::
4747
4848
49- We offer ** three different paths** of how to do this exercise. For
49+ We offer ** four different paths** of how to do this exercise. For
5050the CodeRefinery workshop day 1, we use and demonstrate the ** GitHub
5151path** only and recommend you do that
5252(you can get experience with
@@ -174,6 +174,40 @@ $ git add sides/mixed-nuts.md
174174$ git commit -m " Add mixed nuts recipe"
175175```
176176::::
177+
178+ ::::{group-tab} RStudio
179+ 1 . In the Git tab of the Environment panel (upper right), click New Branch.
180+ 1 . In the pop-up fill in the branch name, e.g. "new-recipe", untick the box in front of Sync branch with remote
181+ to avoid the branch to be pushed to GitHub right away.
182+ 1 . Click Create and RStudio will automatically switch to the new branch.
183+
184+ :::{figure} img/commits/rstudio-create-branch.png
185+ :width: 80%
186+ :class: with-border
187+ :alt: RStudio screenshot of create branch
188+ :::
189+
190+ 1 . Create a new file, for example ` sides/mixed-nuts.md ` . Remember to save any changes to your file before commiting.
191+ 1 . In the Git tab in the Environment panel (upper right) check the box in front of the file you just created, then
192+ click Commit in the tab menu-bar to open the Git Changes window.
193+
194+ :::{figure} img/commits/rstudio-add-commit.png
195+ :alt: Screenshot of RStudio commit process in the main window
196+ :width: 80%
197+ :class: with-border
198+ :::
199+
200+ 1 . In the Changes window, check that your new file is selected (ticked), write a short commit message, and finally
201+ click "Commit"
202+
203+ :::{figure} img/commits/rstudio-commit-changes.png
204+ :alt: Screenshot of RStudio commit process in the changes window
205+ :width: 80%
206+ :class: with-border
207+ :::
208+
209+ ::::
210+
177211:::::
178212
179213
@@ -203,6 +237,12 @@ $ git commit -m "Short summary of the change"
203237Make sure to replace "Short summary of the change" with a meaningful commit
204238message.
205239::::
240+
241+ ::::{group-tab} RStudio
242+ Make some changes to the recipe you created in the step above. Then follow the same instructions as above starting
243+ from step 5.
244+ ::::
245+
206246:::::
207247
208248
@@ -240,6 +280,18 @@ Then modify a file. Finally `git add` and then commit the change:
240280$ git commit -m " Short summary of the change"
241281```
242282::::
283+
284+ ::::{group-tab} RStudio
285+ In the Git tab of the Environment panel (upper right), click your current branch name, here "new-recipe" and then
286+ choose the "main" branch.
287+
288+ :::{figure} img/commits/rstudio-switch.png
289+ :class: with-border
290+ :width: 100%
291+ :alt: Screenshot showing how to switch branch in RStudio
292+ ::::
293+
294+ Modify another recipe and commit your changes.
243295:::::
244296
245297
@@ -313,6 +365,18 @@ emphasize-lines: 1-3
313365* 084a1ea starting with an almost empty readme
314366```
315367::::
368+
369+ ::::{group-tab} RStudio
370+ 1 . Open the history window like you did during the previous lesson.
371+ 2 . Select "(All branches)" in the branch selector drop-down menu to see all the commits on all branches.
372+ :::{figure} img/commits/rstudio-history-all-branches.png
373+ :class: with-border
374+ :width: 80%
375+ :alt: Screenshot of the History window in RStudio showing all branches and all commits
376+ > ** NOTE:** If you don't see the branch selector when you first open the History window, try to switch from the History
377+ > view to the Changes view and back.
378+ ::::
379+
316380:::::
317381
318382
@@ -349,6 +413,12 @@ Try also this if you only want to see the file names that are different:
349413$ git diff --name-only main new-recipe
350414```
351415::::
416+
417+ ::::{group-tab} RStudio
418+ This doesn't seem possible in RStudio without an add-in. We recommend that you use the Terminal in RStudio and follow
419+ the "Command line" path instructions.
420+ ::::
421+
352422:::::
353423
354424
@@ -378,6 +448,12 @@ $ git log --oneline
378448
379449Then try to compare any two commit identifiers with ` git diff ` .
380450::::
451+
452+ ::::{group-tab} RStudio
453+ Again, this doesn't seem possible in RStudio without an add-in. We recommend that you use the Terminal in RStudio and
454+ follow the "Command line" path instructions.
455+ ::::
456+
381457:::::
382458
383459
@@ -404,6 +480,12 @@ Renaming a different branch:
404480$ git branch -m new-recipe better-recipe
405481```
406482::::
483+
484+ ::::{group-tab} RStudio
485+ Again, this doesn't seem possible in RStudio without an add-in. We recommend that you use the Terminal in RStudio and
486+ follow the "Command line" path instructions.
487+ ::::
488+
407489:::::
408490
409491
@@ -437,6 +519,12 @@ Creating a tag:
437519$ git tag -a v1.0 -m " New manuscript version of my recipe for the pre-print"
438520```
439521::::
522+
523+ ::::{group-tab} RStudio
524+ Again, this doesn't seem possible in RStudio without an add-in. We recommend that you use the Terminal in RStudio and
525+ follow the "Command line" path instructions.
526+ ::::
527+
440528:::::
441529
442530
0 commit comments