The GDI SOP repository (GenomicDataInfrastructure/standard-operating-procedures) contains both European-level SOP instances and Node-specific SOP templates. In order to adapt the Node-specific SOP templates, GDI nodes are expected to make a copy of this GitHub repository and modify them to suit them to their needs.
If you are a member of GDI, you are welcome to go through the recorded session where we covered this introduction.
Given that the base repository is public, forks of this repository cannot be private. Therefore, making a node's copy of the repository can be done in different ways, explained in this document, depending on the level of privacy that each node may require:
- Public node's repository. If the node does not require a private repository, copying the source repository is straightforward. See section 1. Public repository.
- Private node's repository. On the contrary, if nodes need their SOP instances to be private (e.g. for security reasons), an alternative route is taken. See section 2. Private repository.
flowchart TD
A[Source Repository]
dec{Node's repo<br>privacy}
A --> dec
dec -->|Public| B(Fork public repository)
dec -->|Private| C(Import)
H[Work with node's<br> repository]
F --> H
B --> H
subgraph Public Path
B
end
subgraph Private Path
C(Import) --> E(Add Upstream Remote)
E --> G(Disable Push to Upstream)
E --> F(Sync with Upstream)
end
Here, we provide step-by-step instructions for forking a GitHub repository using GitHub's user interface.
- Open GitHub and log in to your account.
- Go to GDI SOP repository page.
- Click the "Fork" button in the upper-right corner of the repository page.
- Provide the details of your forked repository:
- Choose as owner your GitHub account or organization to create the fork. This repository will be your node's instance of the
standard-operating-procedures
. Therefore, we recommend you to use your organization's namespace (similar to GenomicDataInfrastructure but for your specific organization), as the repositoryOwner
, instead of your own username. - Provide the name and description that you see fit. We recommend to use the default ones.
- Choose as owner your GitHub account or organization to create the fork. This repository will be your node's instance of the
- Click on "Create fork" and wait a few moments.
- Navigate to your forked repository. It will have your username or organization name at the beginning of the URL (
https://github.com/<your-username>/standard-operating-procedures
). - Clone the fork to your local machine:
Remember to replace
git clone https://github.com/<your-username>/standard-operating-procedures.git cd standard-operating-procedures
<your-username>
with the name that you used as "Owner" when forking. - Start making changes to the existing SOP Templates, the node-specific, creating your node's instance of the SOPs to make them useful for your node.
This rubric guides project partners through the steps to create a private repository from a public GitHub repository and maintain synchronization with the original source.
- Open GitHub and log in to your account.
- Click on "New Repository".
- Click on "Import a repository".
- Follow the instructions to import a repository:
-
Enter the URL of the source repository:
https://github.com/GenomicDataInfrastructure/standard-operating-procedures
-
Enter the details of the new repository.
- This repository will be your node's instance of the
standard-operating-procedures
. Therefore, we recommend you to use your organization's namespace (similar to GenomicDataInfrastructure but for your specific organization), as the repositoryOwner
, instead of your own username. - You can choose any name for the new repository (recommended:
standard-operating-procedures
) - Choose "Private" as your new repository's privacy level. Otherwise, we advise you to follow section 1. Public repository.
Since the source repository is public, no credentials are needed to copy it.
- This repository will be your node's instance of the
-
- Click "Begin Import". Wait for a few moments while GitHub imports the repository.
Once your repository has been imported, we are ready to set the source repository as the upstream remote. This is for your repository (called origin
) to track changes in the source repository (called upstream
):
- Clone your new private repository to your local machine:
Remember to replace
git clone https://github.com/<your-username>/standard-operating-procedures.git cd standard-operating-procedures
<your-username>
with either your organization's namespace or your GitHub username, whichever you used as "Owner" when importing. - Add the public repository as an upstream remote:
git remote add upstream https://github.com/GenomicDataInfrastructure/standard-operating-procedures.git
- Disable pushing to the upstream repository to avoid accidental changes to the public repository:
git remote set-url --push upstream DISABLE
If everything was correctly set, you should see something similar to the following:
$ git remote -v
origin [email protected]:<your-username>/standard-operating-procedures.git (fetch)
origin [email protected]:<your-username>/standard-operating-procedures.git (push)
upstream https://github.com/GenomicDataInfrastructure/standard-operating-procedures.git (fetch)
upstream DISABLE (push)
Whenever there are changes in the source repository, you can sync your node's repository:
- Fetch updates from the public repository (upstream):
git fetch upstream
- Merge or rebase the changes from the upstream repository. If there are conflicts, we advise you to resolve them them manually.
- Merge:
git merge upstream/main --no-edit
- Rebase:
git rebase upstream/main
- Merge:
You are ready to make any changes the existing SOP Templates, the node-specific, creating your node's instance of the SOPs to make them useful for your node.