Skip to content

Commit

Permalink
Added section on github
Browse files Browse the repository at this point in the history
A little meaty, but github doesn't support passwords on git pushes now so need to go the key route
  • Loading branch information
alexiswl committed May 8, 2024
1 parent 9385884 commit 78a42ef
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 4 deletions.
35 changes: 31 additions & 4 deletions learners/files/data_setup.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,34 @@ You will need to download some example files for this lesson. In this tutorial w
### Setting up a practice Git repository

For this tutorial some existing tools are needed to build the workflow. These existing tools will be imported via GitHub.
First we need to create an empty git repository for all our files. To do this, use this command:


#### Make a repository on GitHub.com

Head to [github.com/new][github_new_repo] and create a new repository.

Name it `novice-tutorial-exercises`.

Make sure the repository is `public`.

Check 'Add a README file', and choose `GNU General Public License v3.0` as your license.

#### Clone the repository

```bash
git init novice-tutorial-exercises
git clone [email protected]/YOUR_GITHUB_USERNAME/novice-tutorial-exercises
```

Next, we need to move into our empty git repo:
Next, we need to move into our git repo:

```bash
cd novice-tutorial-exercises
```

<br>

#### Add in bio-cwl-tools as a submodule

Then import bio-cwl-tools with this command:

```bash
Expand All @@ -25,6 +41,7 @@ git submodule add https://github.com/common-workflow-library/bio-cwl-tools.git

<br>


### Downloading sample and reference data

Create a new directory inside the `novice-tutorial-exercises` directory and download the data:
Expand Down Expand Up @@ -61,6 +78,16 @@ We should exclude the rnaseq folder from being tracked in this repository.
echo 'rnaseq/' >> .gitignore
```

### Add .gitignore to git

`.gitignore` is a file that is tracked like all other GitHub commands.

```
git add .gitignore
git commit -m "Don't track files in the rnaseq directory"
git push
```

<br>

### STAR Genome index
Expand Down Expand Up @@ -303,4 +330,4 @@ Then retry the `md5sum` command

[dos2unix]: https://phoenixnap.com/kb/convert-dos-to-unix
[checksum_wiki]: https://en.wikipedia.org/wiki/Checksum

[github_new_repo]: https://github.com/new
67 changes: 67 additions & 0 deletions learners/files/github.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
## GitHub Requirements

This part assumes you have a GitHub.com account.

If you do not have a GitHub.com account you can create one [here][github_signup]

Check warning on line 5 in learners/files/github.Rmd

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[uninformative link text]: [here](https://github.com/signup)

The following steps will take you through the process of creating a SSH key pair to
connect your terminal to GitHub. If you already have this set up, you may skip this part.


:::::::::::::::::: callout


### Opening files from the terminal

Whenever you are required to open a file from the terminal, you may type `code /path/to/file`.

This will also create the file if it does not yet exist.

::::::::::::::::::


### SSH Key

After generating an account you will need to generate an SSH Key so that you can pull and push code from your terminal to GitHub.

In your terminal run the following command

```
# Create the .ssh directory
mkdir -p --mode 700 ~/.ssh
ssh-keygen -f ~/.ssh/github -t ed25519 -q -N ""
```

### Add your public key to GitHub

Head to [GitHub SSH and GPG keys][github_settings].

Click `New SSH key`.
set the title as the name of your computer (this can be anything), and under the 'Key',
copy the contents of `~/.ssh/github.pub` from your terminal.

### Setting your SSH Config

Open up `~/.ssh/config` and add in the following code chunk:

```
Host github.com
IdentityFile /home/YOUR_USER_NAME/.ssh/github
User git
```

### Test your connection

```
ssh -T [email protected]
```

You should see a message like so

```
Hi alexiswl! You've successfully authenticated, but GitHub does not provide shell access.
```

[github_signup]: https://github.com/signup
[github_settings]: https://github.com/settings/keys
5 changes: 5 additions & 0 deletions learners/setup.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ dot - graphviz version 2.43.0 (0)
```


```{r, child = 'files/github.Rmd'}
```

```{r, child = 'files/data_setup.Rmd'}
```

0 comments on commit 78a42ef

Please sign in to comment.