-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0021-local-setup-ssh.Rmd
More file actions
83 lines (47 loc) · 4.92 KB
/
0021-local-setup-ssh.Rmd
File metadata and controls
83 lines (47 loc) · 4.92 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
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
# Local Setup and SSH {#local-setup}
You'll only need to do these steps once.
## SSH Connection
We need to create an SSH connection, which is a secure link to GitHub using a cryptographic key instead of a password. It's a highly secure method that allows you to push and pull code without having to enter your credentials every time. If you've already been git cloning, pushing, and pulling, you have your SSH connection set up and can skip this step.
You can run the commands in this section from **anywhere in your computer** - folder does not matter.
:::: {.callout type="blue" title="Output VS Commands in the GitHub Docs" collapsible="false" style="subtle" icon="true"}
Commands are prefixed with a $ to simulate the terminal prompt. This character indicates where a command begins but is not part of the command itself, so do not copy it.
Output is prefaced by a "\>" sign.
::::
### Generate an SSH key
This step creates a unique cryptographic key pair that acts as a secure, digital identity for your computer.
* [Mac](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key)
* [Windows](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent?platform=windows#generating-a-new-ssh-key)
If you have already created a SSH key and you are asked to rewrite another key, look at [the highlighted section here.](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key:~:text=Please%20note%20that%20if%20you%20created%20SSH%20keys%20previously%2C%20ssh%2Dkeygen%20may%20ask%20you%20to%20rewrite%20another%20key%2C%20in%20which%20case%20we%20recommend%20creating%20a%20custom%2Dnamed%20SSH%20key.%20To%20do%20so%2C%20type%20the%20default%20file%20location%20and%20replace%20id_ALGORITHM%20with%20your%20custom%20key%20name)
:::: {.callout type="yellow" title="Before you freak out" collapsible="false" style="subtle" icon="fas fa-lightbulb"}
When typing your passphrase, your computer is so secretive that you won't see it being typed. You won't see a cursor moving and you won't see ● instead of the characters you're typing. Rest assured, your computer is receiving your text.
If you make a mistake, it's best to hit the "delete" bar many times and retype.
::::
### Add your SSH key to the ssh-agent
This step loads your private key into a secure background utility so you don't have to type your passphrase for every connection.
* [Mac](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent?platform=mac#adding-your-ssh-key-to-the-ssh-agent)
* [Windows](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent?platform=windows#adding-your-ssh-key-to-the-ssh-agent)
### Add your SSH key to your GitHub account
This step adds your public key to your GitHub account to authorize your computer, allowing it to access your repositories without a password.
* [Mac](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account?platform=mac#adding-a-new-ssh-key-to-your-account)
* [Windows](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account?platform=windows#adding-a-new-ssh-key-to-your-account)
## GitHub Folder {#github-folder}
### Create your folder
Create a folder on your computer to hold all your CBW repos. **We recommend** placing it in your Documents folder and naming it CBWGithub, but if you're confident with the command line, you can mix up the name and location. We will refer to this folder as CBWGithub for the rest of this document.
### Clone the GitHub homepage
We need to download the homepage repo for the website, since you'll be linking your workshop pages there.
Go to the folder you just created using your Terminal or PowerShell. You can do this using the [command line](#command-line) or the shortcuts [listed here](#handy-shortcuts). Once you're there, run the following command:
```
git clone git@github.com:bioinformaticsdotca/bioinformaticsdotca.github.io.git
```
You can use `ls` to see the contents of your folder; you should now see a subfolder named bioinformaticsdotca.github.io.
### Clone the travel logistics repo
In the same folder, run:
```
git clone git@github.com:bioinformaticsdotca/travel_logistics.git
```
## Set merge preferences {#merge-prefs}
Run this command in your terminal (the folder doesn't matter). We are using `--global` to set this preference for *all* your Git projects, so you never have to do this again.
```
git config --global pull.rebase false
```
*(If you only want this setting for a given repo, you can run this command in that repo leaving out `--global`, but it's safe to set globally.)*