-
Notifications
You must be signed in to change notification settings - Fork 3
/
session-prework.qmd
88 lines (58 loc) · 2.59 KB
/
session-prework.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
title: "Introduction to Git and GitHub"
subtitle: "Session - Prework for a computer"
---
## Check Git
Check if Git is already installed. Run the following in the *Terminal* (not the RStudio Console!)
```
which git
```
Check the version of your Git
```
git --version
```
If asked to install the Xcode command line tools, say yes!
Right click to copy on a Terminal line
## Downloading Git
- Download the installer from [https://git-scm.com/downloads](https://git-scm.com/downloads)
- Run keeping all the default settings.
:::{.callout-note collapse=false appearance='default' icon=true}
## Installer hangs at 100%
If the installer hangs with the progress bar at 100%, close the installer with Task Manager (press `Ctrl + Alt + Delete`;
select Task Manager;
find Git for Windows installer and close).
:::
## Connecting RStudio to Git
- Open RStudio
- In the menus go to `Tools > Global Options > Git/SVN`
- Check RStudio has found Git under "Git executable:"
You may need to click `Browse` and find the Git executable
:::{.callout-note collapse=false appearance='default' icon=true}
## Where to find the git.exe
It may be under `C:\Users\username\AppData\Local\Programs\Git\` - remember if file extensions are hidden it will show as git rather than git.exe.
Restart RStudio before trying to use git.
:::
## GitHub
Register a GitHub account at [github.com](https://github.com/).
- Suggest to incorporate your actual name/reuse your username from other contexts (like Social Media)
- Pick a username you will be comfortable revealing to your boss
- Shorter is better
- Be as unique as possible in as few characters as possible
- Make it timeless
- Avoid words laden with special meaning in programming
- Use all lower case letters
## Think about security
Particularly for GitHub and your own account safety
Set up [2FA (two-factor authentication)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication) using an app or save the generated code
## Install packages
The following packages are required for the course:
```{r}
install.packages("gert")
install.packages("usethis")
install.packages("gitcreds")
```
## End session
# Acknowledgements
These slides were designed by Mine Çetinkaya-Rundel and Emma Rand for the Forwards Package development module course
[Your first package](https://forwards.github.io/workshops/package-dev-modules/slides/03-your-first-package/your-first-package.html#1) and
[Setting up your system](https://forwards.github.io/workshops/package-dev-modules/slides/02-setting-up-system/setting-up-system.html#1)