-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0034-clone.Rmd
More file actions
66 lines (42 loc) · 3.25 KB
/
0034-clone.Rmd
File metadata and controls
66 lines (42 loc) · 3.25 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
# Clone to your computer {#clone}
Now that the website is created, let's bring it to your computer where you can easily make edits. We'll use the `git clone` command for this.
1. Navigate to the folder you created in [Local Setup](#local-setup) using Terminal/Windows PowerShell/Command Prompt.
::: {.callout type="blue" style="plain" title="Opening your folder in the command line" collapsible="true"}
You can use the cd command to navigate. Some easier options, if you prefer:
On **Windows**
*Method 1*: Shift + Right-click
* Open Windows File Explorer and navigate to the folder you want to open in the terminal.
* Hold down the Shift key and right-click on the folder (or an empty area within the folder).
* Select "Open in Terminal" from the context menu. <br>
*Method 2*: Typing "cmd" in the address bar
* Open Windows File Explorer and navigate to the folder.
* Click in the address bar at the top of the window.
* Type `cmd` and press Enter. <br><br>
On **Mac**
* Locate and open the folder you want to use in Finder.
* If you don't see the path bar at the bottom of the Finder window, go to View > Show Path Bar.
* In the path bar, right-click (or Control-click) the folder.
* Select Open in Terminal <br><br>
Note that the `pwd` command gives you the *path to your working directory*. You may want to use this in your CBWGithub folder and paste the output somewhere where you can quickly find it, so it is easier to navigate to in the future.
:::
2. Get your repo's SSH URL.
Find the ssh for your workshop repository:
a) Click the green button entitled `< > Code` and see the drop down options.
b) Click the SSH tab, as seen below, and then copy the text below it. The text should be something like [git\@github.com](mailto:git@github.com){.email}:bioinformaticsdotca/WORKSHOP-NAME.git, as seen below.
::: {.callout type="gray" title="See image" collapsible="true" style="plain" icon="fa-solid fa-image"}
\
:::
c) **Edit** and **run the following command** in Terminal/PowerShell/Command Prompt, within the folder you want the workshop folder to be in. (Recall that we navigated there in step 1.)
::: {.callout type="green" title="Edit this command!"}
Type "git clone ", paste the SSH url, and then hit enter. The command is below, but you must delete the entire "git\@github.com:bioinformaticsdotca/[YOUR WORKSHOP NAME].git" text, and replace it with the text you copied.
```
git clone git@github.com:bioinformaticsdotca/[YOUR WORKSHOP NAME].git
```
::::
3. You should be ready to go! With your given permissions, you should be able to git push (put your local edits on GitHub) and git pull (pull edits on GitHub to your local computer) fine!
## Oops, I Git Cloned the Wrong Repository! {#delete-git-folder-locally}
That's okay! To delete the entire local repository and the folder itself, run the following command:
```
rm -fr folder-path
```
where "folder-path" is a file address to the repo that you want to delete. *Double check that the path is correct before running this command, as it cannot be undone.*