Repository navigation
Expand file tree
/
Copy path01-02-installing-git.qmd
More file actions
45 lines (39 loc) · 2.02 KB
/
Copy path01-02-installing-git.qmd
File metadata and controls
45 lines (39 loc) · 2.02 KB
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
# Installing Git and GitHub Desktop
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, fig.align = "center")
```
## Installing Git
(It turns out that GitHub Desktop has a version of Git within it. If you only ever intend to use Git through GitHub Desktop you don't need to install Git and can skip to the GitHub Desktop section.)
- Windows
- Download and install from [here](https://git-scm.com/download/win)
- macOS comes with an out-dated version of Git
- I recommend installing the Homebrew version
- First install Homebrew, see instructions [here](https://brew.sh/)
- Then run in your Terminal app
```bash
brew upgrade
brew install git
```
- Additionally on a Mac it is helpful to install Xcode command line tools (i.e., avoid installing the whole of Xcode.)
```bash
xcode-select --install
```
- You must reinstall these tools everytime you upgrade macOS major versions, e.g., when you've upgraded from Big Sur to Monterey etc.
- Once Git is installed its executable (called `git` on macOS and Linux and `git.exe` on Windows) should be available at your command line
- Check which version you have with (you want something recent-ish)
```bash
git --version
```
- On my Mac currently I have
```
git version 2.39.1
```
## Installing GitHub Desktop
- You could use Git through its command syntax however I recommend you use a graphical Git client
- For Windows and macOS download and install GitHub Desktop from [here](https://desktop.github.com/)
- A Linux version of GitHub Desktop is available from [here](https://github.com/shiftkey/desktop/)
- I recommend installing the free VSCode text editor, from [here](https://code.visualstudio.com/), and setting that as the "External editor" in GitHub Desktop options (Click: File | Options...)
```{r, out.width = "100%"}
knitr::include_graphics("img/ghd-options-vscode.png")
```
- On Windows I also recommend installing Windows Terminal from [here](https://www.microsoft.com/store/productId/9N0DX20HK701)