Set up OSS with your hackweek repository#

Ian Fenty and Andrew Delman, 2024-09-26

This tutorial describes how to 1) link your existing GitHub account to your new OSS environment, 2) fork and clone the “ecco-2024” GitHub repository onto your local OSS disk, and 3) set up the upstream repository (the original “ecco-2024” repo) so you can pull updates from it directly to your local version.

Fork and Clone the hackweek repository
Add upstream remote (shared repository)

Fork and Clone the hackweek repository#

By default, the OSS system does not have any notebooks or codes loaded. To get the Hackweek “ecco-2024” Github repository and its associated Jupyter Notebooks and Python codes, we suggest that you fork and clone the repo to your OSS account.

Forking and cloning a repository is beneficial because it:

  • Forking allows you to create your own copy of a project under your GitHub account.

  • You can freely experiment, make changes, and develop features without affecting the original project.

  • After cloning the forked repository, you can sync updates from the original repository and contribute back via pull requests.

Fork the “ecco-2024” repository#

  1. Log into your GitHub account

  2. Navigate to the ecco-2024 Github Page

  3. Click Gray Fork Button: Detailed Forking Instructions

  4. In the “Create a new fork” page, choose yourself as the “Owner”

  5. Click Green “Create fork” button

  6. After a few seconds, a new page will appear with your new forked repository

Clone the “ecco-2024” repository#

  1. Click Green “<> Code” button

  2. In the “Local Tab”, select the “HTTPS” tab if you previously set up a personal access token, or “SSH” if you set up an SSH key.

  3. Copy the link to the clipboard (select and copy or use handy copy button with the two squares)

  4. Return to the OSS JupyterLab terminal window

  5. go to your home directory cd ~/

  6. clone the link that you copied: ex) git clone https://github.com:...

    • If using an SSH key, enter the passphrase (or no passphrase) that you used when creating the key.

Note

If you get an error message when using your SSH key such as WARNING: UNPROTECTED PRIVATE KEY FILE!, then it means the permissions for your private key are too open. You may keep getting this message periodically as OSS seems to reset the permissions on it periodically for some reason. This can be resolved by making your private key read-only by you (the owner of the file): chmod 400 ~/.ssh/id_ed25519.

Now you should have a directory called ecco-2024 under your home directory /home/jovyan.

Note

This repository includes a number of tutorial notebooks that use ECCO data; they can be found in the subdirectories under the directory ~/ecco-2024/book/tutorials.

Add upstream remote (shared repository)#

When you cloned the ecco-2024 repository, you actually cloned the fork of the repo that you own, and that is designated for your code changes. So the local version of the repo is what you have on your machine (i.e., OSS), and the remote of this repo (called origin) is your fork on Github. You can check this by going to the repo directory cd /home/jovyan/ecco-2024 and running git remote -v. You will see something like:

origin  https://github.com/{username}/ecco-2024.git (fetch)
origin  https://github.com/{username}/ecco-2024.git (push)

or if you are using an SSH key, you will see git@github.com: instead of https://github.com/.

But in addition to the origin, you will also want to have direct access to the source ecco-2024 repository that everyone shares (for example, to pull contributions from others into your local version of the repo). This shared repo on Github is typically called the upstream repo. If you are using an HTTPS-based token, you can add upstream as a second remote with this command:

git remote add upstream https://github.com/ECCO-Hackweek/ecco-2024.git

or if you are using an SSH key:

git remote add upstream git@github.com:ECCO-Hackweek/ecco-2024.git

Now if you run git remote -v again, you can see the URLs of both remotes (origin and upstream), e.g.,:

origin  https://github.com/{username}/ecco-2024.git (fetch)
origin  https://github.com/{username}/ecco-2024.git (push)
upstream        https://github.com/ECCO-Hackweek/ecco-2024.git (fetch)
upstream        https://github.com/ECCO-Hackweek/ecco-2024.git (push)

You can see this link for more information about managing remote repos.