Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clone the repo #113

Merged
merged 19 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/components/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ conda
config
DM
doxxing
dropdown
formatters
GitHub
GitKraken
Expand Down
8 changes: 8 additions & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ To serve the documentation during local development, run `mkdocs serve` from the
- [Docs organization](#docs-organization)
- [Adding new documentation](#adding-new-documentation)
- [Linking to other pages](#linking-to-other-pages)
- [Phrasing](#phrasing)


## Docs organization
Expand Down Expand Up @@ -85,3 +86,10 @@ For example:
```
This sentence should link to the [pull request documentation](STUB_LINK).
```


## Phrasing

For consistency, please use the following:

- Refer to `github.com` as `GitHub`
sjspielman marked this conversation as resolved.
Show resolved Hide resolved
Binary file added docs/img/add-upstream-remote-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/add-upstream-remote-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/add-upstream-remote-3.png
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just noting i replaced this with a smaller screenshot, it was too long before i think

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions docs/technical-setup/clone-the-repo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Clone the repository

After [forking the `OpenScPCA` repository](./fork-the-repo.md), you will need to _clone_ your forked repository to your computer.
Cloning provides you with a local copy of the repository to work with.
You will need to clone the repository to every computer (or remote server) you want to use to contribute to the project.

!!! note
You should clone your forked repository from `<username>/OpenScPCA-analysis`, _not_ `AlexsLemonade/OpenScPCA-analysis`.


## Clone your forked repository

Please follow the [instructions in this GitKraken video](https://help.gitkraken.com/gitkraken-client/open-clone-init/#cloning-an-existing-project) to clone your repository.

This video presents two approaches to cloning: `Clone with URL`, and Clone based on your integrated `GitHub` account.
Either approach is fine to take!

While watching these instructions, please bear in mind the following:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to mention anything about the difference between SSH and http here? If they have not set up SSH, they probably need to use the http version (This is what the clone from github.com will do by default)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My sense is that things would just kind of work if they have signed into GitKraken with their github account, so I was trying to hide this "advanced" sort of information to avoid throwing too much information at them that isn't directly related to steps they need to take.

What level of detail are you proposing to add here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that is quite true. GitKraken only sets up https by default, I think. If you already have SSH keys, it will use them, and it can create and update SSH keys if you ask it to, but in the most basic setting it will only set up for http.

I would just recommend that they choose http unless they have set up SSH. Basically, if you know what you are doing you can choose ssh, but otherwise you probably want http.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, took a stab at it, let me know what you think!


- Do not change the "Full path" field when cloning.
You should retain the folder name `OpenScPCA-analysis`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to tell people this? Why can't they change the name locally?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose it doesn't matter, just wanted to give some guidance about how they should interact with this step. Would you suggest telling them to choose their own journey here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just wouldn't specify. The video doesn't show changing the default, I don't think, so no need to mention it.

- You can feel free to ignore all references to `LFS` ("large file storage") in this video.
This does not apply to `OpenScPCA-analysis`.

## Add the project repository as a remote repository

The next step is to link the upstream repository (`AlexsLemonade/OpenScPCA-analysis`) as a remote.
A _remote_ is a repository on `GitHub` that you are connected to.
Each remote repository is given a name to make referring to them easier.
For example, your forked repository on `GitHub` is called `origin` because it is where your local repository was cloned from.

We will add another remote repository named `upstream` that refers to the original `AlexsLemonade/OpenScPCA-analysis` repository on `GitHub`.
This will be called `upstream` because it was the source that your fork came from.

Adding the `AlexsLemonade` _upstream remote_ will allow you to interact with it from your computer which can help you keep your fork in sync with the `OpenScPCA` project.
But, you will still be working in your fork when writing analysis code.

Follow these steps to add the upstream remote:

1. From your repository in GitKraken, hover over the `1/1` text on the left-hand side `Remote` menu.
This text will then turn into a plus-sign icon.
Click that icon.
![Click button to add the remote.](../img/add-upstream-remote-1.png){width="600"} <!-- No new line above, to keep tabbed in -->
sjspielman marked this conversation as resolved.
Show resolved Hide resolved

1. The following screen will prompt you to add a remote.
Select `AlexsLemonade/OpenScPCA-analysis` from the dropdown menu, and click the button `Add remote`.
![Add the upstream remote.](../img/add-upstream-remote-2.png){width="400"} <!-- No new line above, to keep tabbed in -->
sjspielman marked this conversation as resolved.
Show resolved Hide resolved

1. You should then see a second remote called `AlexsLemonade` on the left-hand side `Remote` panel.
The specific listed items under this remote that you see will look different from the screenshot below; this is expected.
As long as you see that `AlexsLemonade` is listed in the menu, you have successfully added the upstream remote.
![View the added remote.](../img/add-upstream-remote-3.png){width="325"} <!-- No new line above, to keep tabbed in. Width needs to be >=325 for proper spacing, it seems. -->
9 changes: 5 additions & 4 deletions docs/technical-setup/fork-the-repo.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

You will need to create a [_fork_](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo#about-forks) of the [`OpenScPCA-analysis`](https://github.com/AlexsLemonade/OpenScPCA-analysis/) repository.

A fork is a copy of an _upstream_ repository (here, `AlexsLemonade/OpenScPCA-analysis` is the _upstream_) that you will own and will be in your GitHub account.
A fork is a copy of an _upstream_ repository (here, `AlexsLemonade/OpenScPCA-analysis` is the _upstream_) that you will own and will be in your `GitHub` account.
As a contributor, you will perform analyses in your fork.
Just like the upstream `AlexsLemonade/OpenScPCA-analysis` repository, your fork will also be a public repository.

One benefit of using a fork is that changes you make will not affect the upstream project in `AlexsLemonade/OpenScPCA-analysis`.
This means you can safely work on your analyses without worrying about messing anything up in the upstream repository.
Expand All @@ -19,10 +20,10 @@ Follow these steps to create your fork:

1. At the top right corner, click the "Fork" button:
(The numbers you see in this screenshot may differ from the numbers on the website - that's ok!)
![Button on GitHub.com to fork a repository.](../img/fork-button.png){width="400"} <!-- No new line above, to keep tabbed in -->
![Button on `GitHub` to fork a repository.](../img/fork-button.png){width="400"} <!-- No new line above, to keep tabbed in -->
sjspielman marked this conversation as resolved.
Show resolved Hide resolved


1. On the next screen, GitHub will prompt you for some settings about your fork.
1. On the next screen, `GitHub` will prompt you for some settings about your fork.
Make sure that these conditions are met, and then click the "Create fork" button on the bottom right.
- Although the screenshot below shows an "Owner" username of `sjspielman`, you should see your username in this field.
- Keep the default Repository name as `OpenScPCA-analysis`.
Expand All @@ -32,4 +33,4 @@ Make sure that these conditions are met, and then click the "Create fork" button


1. That's it! 🎉
In a few moments, GitHub will redirect to your newly forked repository at `https://github.com/YOUR_USERNAME/OpenScPCA-analysis`, and you're ready to proceed to the next step of [cloning your repository](./clone-the-repo.md).
In a few moments, `GitHub` will redirect to your newly forked repository at `https://github.com/YOUR_USERNAME/OpenScPCA-analysis`, and you're ready to proceed to the next step of [cloning your repository](./clone-the-repo.md).
8 changes: 4 additions & 4 deletions docs/technical-setup/install-a-github-client.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Install a GitHub client

You will need a platform on your computer to run Git commands and interact with [GitHub.com](https://github.com).
You will need a platform on your computer to run Git commands and interact with [GitHub.com](https://github.com) (`GitHub`).

There are many platforms you can choose, but we recommend using either [**GitKraken**](https://www.gitkraken.com/) or the [Git **command line interface**](https://git-scm.com/book/en/v2/Getting-Started-The-Command-Line).

Expand All @@ -19,8 +19,8 @@ GitKraken is free to use with public repositories like `OpenScPCA-analysis`; you

1. Install GitKraken [using this link](https://www.gitkraken.com/download).

2. Set up GitKraken on your machine by [directly signing in with your GitHub account](https://help.gitkraken.com/gitkraken-client/github-gitkraken-client/#sign-in-with-github).
This will automatically provide you with the credentials you need to interact with GitHub without further setup.
2. Set up GitKraken on your machine by [directly signing in with your `GitHub` account](https://help.gitkraken.com/gitkraken-client/github-gitkraken-client/#sign-in-with-github).
This will automatically provide you with the credentials you need to interact with `GitHub` without further setup.


## Why use the Git command line interface?
Expand All @@ -38,7 +38,7 @@ The instructions for this depend on your operating system, as described below.

After installing Git, you will also need take these steps:

- [Set up an SSH key](https://docs.github.com/en/authentication/connecting-to-github-with-ssh) to interact with GitHub
- [Set up an SSH key](https://docs.github.com/en/authentication/connecting-to-github-with-ssh) to interact with `GitHub`
- [Set up your Git config file](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup)

### Install Git on macOS
Expand Down
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ plugins:

markdown_extensions:
- admonition # https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown/#admonition
- attr_list # https://github.com/squidfunk/mkdocs-material/blob/master/docs/setup/extensions/python-markdown.md#attribute-lists
- attr_list # https://github.com/squidfunk/mkdocs-material/blob/master/docs/setup/extensions/python-markdown.md#attribute-lists

# Here is the basic structure of our navigation setup.
#nav:
Expand All @@ -41,6 +41,7 @@ nav:
- technical-setup/index.md
- technical-setup/install-a-github-client.md
- technical-setup/fork-the-repo.md
- technical-setup/clone-the-repo.md
- Tools for communication: # Slack, issues, discussions
- communications-tools/index.md
- Contributing to analyses: # Setting up an analysis, all the git stuff
Expand Down