-
Notifications
You must be signed in to change notification settings - Fork 17
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
Working with branches documentation #181
Changes from 19 commits
960cda8
faa9c65
e5dd6c6
a692fab
7bdb64b
dbb96fd
36ec514
0be704f
01a8a65
4d271cb
92e3460
643a93a
2a31a87
31187d9
5948823
cc680b4
a955c31
1d8af57
92c7a77
bb7eeb2
fd4fd5d
8bf5f8d
1366a9b
1316fdf
c9b4099
aed9467
b893f67
082efe0
96a1b03
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ precommit | |
README | ||
redistribution | ||
renv | ||
repo | ||
reproducibility | ||
RStudio | ||
Rtools | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,63 @@ | ||||||
# Working with branches | ||||||
|
||||||
## What is a branch? | ||||||
|
||||||
A branch in GitHub refers to an isolated copy of the repository contents. | ||||||
For example, the `main` branch of the `OpenScPCA-analysis` repository contains the main copy of all items in the repository. | ||||||
|
||||||
!!! note | ||||||
allyhawkins marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
For more details on branches, see [GitHub's documentation describing branches](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches) and [this tutorial on creating branches with GitKraken](https://www.gitkraken.com/learn/git/problems/create-git-branch). | ||||||
|
||||||
|
||||||
## What is a feature branch? | ||||||
|
||||||
Instead of directly making code changes in the `main` branch, we write code in a _feature branch_ created off of the `main` branch. | ||||||
A feature branch contains a copy of in an isolated space. | ||||||
allyhawkins marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
By using feature branch, you can make code changes without affecting the code in the `main` branch or interfering with other contributors as they make changes. | ||||||
allyhawkins marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
## When should you use a feature branch? | ||||||
allyhawkins marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
Every time you make a new addition or modify existing code, you will want to create a _new_ feature branch. | ||||||
allyhawkins marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
Every pull request should contain changes made in a _single_ feature branch. | ||||||
allyhawkins marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
## Overview of working with branches in OpenScPCA | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we might want to make this the first section? If people are familiar with Git, they might want this information first. If they are not, we can direct them to keep reading. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure about this - I think for advanced users I'd rather they just scroll a little (this is one reason to keep nested headers above, makes this section a little more obvious I think), but for beginners it would be overwhelming to see this list before having the "what are branches and why" context. Basically I'm less concerned with advanced contributors vs beginners, and I think it's best to structure docs based around beginners' needs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Part of my reasoning is that this also is the why for this whole page. I would make this header first, and add "We use branches in OpenScPCA because..." before the bulleted list. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moving this section entirely broke the flow to me and I wasn't a fan. So I came up with a compromise and included a brief "why do we use branches in OpenScPCA" as the intro before any of the sections. Then you can read on for more details. You can see this update in b893f67. |
||||||
|
||||||
- When you are working on your own analyses or proposing a change to the main code base, we ask that you first fork the repository and then create a feature branch from the `main` branch of your fork. | ||||||
allyhawkins marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
- Haven't forked yet? Please see [Forking the repo](STUB-LINK). | ||||||
allyhawkins marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
- You should then incorporate or add any changes that you make to that feature branch (see [Making commits](STUB-LINK)). | ||||||
allyhawkins marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
- Then create and file a pull request to the `main` branch of `OpenScPCA-analysis` to request to incorporate your additions into the main code base (see [Creating pull requests](STUB-LINK)). | ||||||
allyhawkins marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
## Creating a feature branch in GitKraken | ||||||
|
||||||
Follow these steps to create your feature branch: | ||||||
|
||||||
1.Open the GitKraken GUI interface and make sure you are on the `main` branch of your fork of `OpenScPCA-analysis`. | ||||||
allyhawkins marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
You can do this by checking the `main` box listed under the `Local` menu. | ||||||
|
||||||
<figure markdown="span"> | ||||||
![Click button to checkout main](../../img/working-with-branches-1.png){width="600"} | ||||||
</figure> | ||||||
sjspielman marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
2.Create and checkout a new branch by right-clicking on the `main` branch and selecting `Create branch here`. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's get a little more specific - you can either do this in the local menu, or in the graph. Which do we recommend? Would an arrow help? |
||||||
|
||||||
<figure markdown="span"> | ||||||
![Create branch](../../img/working-with-branches-2.png){width="600"} | ||||||
</figure> | ||||||
|
||||||
3.You will then be prompted to name your branch. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. space!
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just noting that the only way that I've gotten the numbering to work correctly is to actually not use any spaces. It should be correct now and I double checked on the build. |
||||||
We encourage users to name their branch using their GitHub username followed by a description of what changes will be included in the branch. | ||||||
For example, if you are adding an analysis to add cell type annotations to Ewing sarcoma samples, you might name your branch `username/celltype-ewings`. | ||||||
|
||||||
<figure markdown="span"> | ||||||
![Name branch](../../img/working-with-branches-3.png){width="600"} | ||||||
</figure> | ||||||
|
||||||
!!! note | ||||||
allyhawkins marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
Pro tips for creating branch names: | ||||||
allyhawkins marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
- Branch names should always be unique, so don't reuse old branch names! | ||||||
- Names should not contain any special symbols besides `_` and `-`. | ||||||
- It can be extra helpful to include the issue number in your branch name, e.g., `username/42-celltype-ewings`. | ||||||
|
||||||
|
||||||
You have now successfully created a new branch and are free to make changes to the code and continue with your analysis! | ||||||
allyhawkins marked this conversation as resolved.
Show resolved
Hide resolved
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we actually make this arrow thicker? It's very small compared to the rest of the image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can delete this if you want