Skip to content

Commit

Permalink
Merge pull request #158 from NESCent/update-contributing
Browse files Browse the repository at this point in the history
Update CONTRIBUTING.md
  • Loading branch information
zkamvar committed Mar 7, 2016
2 parents f4f0e8a + 865e763 commit 19ef163
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 21 deletions.
50 changes: 37 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,45 @@ Overall, vignette submission will follow the guidelines in [GitHub flow](https:/
Since this process requires git, if you are having trouble installing git or accessing your command line, please take a look at our detailed tutorial on using git through R: [Contributing with git2r](CONTRIBUTING_WITH_GIT2R.html).


## Setup for new contributors

If you are a new contributor, you will need to make sure you have git set up and a fork of this repository. Please follow these instructions carefully. If you have already set up your repository, go to the next section.

1. Set up a GitHub account if you don't already have one, see [here](https://guides.github.com/activities/hello-world/) for a quick tutorial on using GitHub.
2. Download an appropriate Git client for your computer, see [here](https://help.github.com/articles/set-up-git/), and set it up.
3. Fork the [source repository](http://github.com/NESCent/popgenInfo) on GitHub using the `Fork` button (See [GitHub's tutorial](https://help.github.com/articles/fork-a-repo/)).
4. On the command line, clone the repository to your machine using
`git clone https://github.com/YourAccount/popgenInfo.git`
Note: the https protocol is easier to follow, but it's possible to use ssh as well ([details here](https://help.github.com/articles/fork-a-repo/#step-2-create-a-local-clone-of-your-fork)).
5. Add the NESCent repository as upstream with
`git remote add upstream https://github.com/NESCent/popgenInfo.git`
to keep your fork up to date with the master repository. [See these instructions for details](https://help.github.com/articles/fork-a-repo/#step-3-configure-git-to-sync-your-fork-with-the-original-spoon-knife-repository)

## Step-by-step process for submission

1. Set up a GitHub account if you don't already have one, see [here](https://guides.github.com/activities/hello-world/) for a quick tutorial on using GitHub. Download an appropriate Git client for your computer, see [here](https://help.github.com/articles/set-up-git/), and set it up.
2. Fork the [source repository](http://github.com/NESCent/popgenInfo) on GitHub using the `Fork` button (See [GitHub's tutorial](https://help.github.com/articles/fork-a-repo/)).
3. Clone the repository to your machine using `git clone https://github.com/YourAccount/popgenInfo.git` on the command line. Note: the https protocol is easier to follow, but it's possible to use ssh as well ([details here](https://help.github.com/articles/fork-a-repo/#step-2-create-a-local-clone-of-your-fork)). Follow [these instructions](https://help.github.com/articles/fork-a-repo/#step-3-configure-git-to-sync-your-fork-with-the-original-spoon-knife-repository) to keep your fork up to date with the master repository.
4. Then, from the command line, move to the popgenInfo directory using `cd popgenInfo`.
5. Create a branch for your changes using `git checkout -b Your_branch_name`.
6. If you are on windows or macintosh, you can open Rstudio by double-clicking on the `popgenInfo.Rproj` file in your file browser. If you are on linux, you can open it by typing `rstudio popgenInfo.Rproj`.
7. If you haven't done so, create your vignette from the [`TEMPLATE.Rmd`](https://github.com/nescent/popgenInfo/tree/master/TEMPLATE.Rmd) file and move any associated data to the **data/** directory.
6. Move your vignette in `.Rmd` format into the **use/** directory.
8. Add the file to git using `git add use/yourfilename.Rmd`.
9. Then commit this using `git commit` and add some short text describing what your file is.
10. Then run `git push origin Your_branch_name`.
11. To do a pull request, navigate to your branch on GitHub. Click `Compare & review` or the pull request icon.
12. Once you have reviewed the changes, click `Create pull request`. Once the request is approved, the file will be automatically sent to a remote server that compiles the document into a html file.
If you have a vignette you would like to submit, please follow these instructions to submit it for review.

1. Update your fork
1. From the command line, move to the **popgenInfo** directory using `cd popgenInfo`
2. Switch to your master branch with `git checkout master`
3. Update with
```sh
git fetch upstream # grab all the changes from NESCent
git merge upstream/master # add them to your local fork
git push # push them up to your fork on github
```

2. Create a branch for your changes using `git checkout -b Your_branch_name`.
3. Add your vignette
1. If you are on windows or macintosh, you can open Rstudio by double-clicking on the **popgenInfo.Rproj** file in your file browser. If you are on linux, you can open it by typing `rstudio popgenInfo.Rproj`.
2. If you haven't done so, create your vignette from the [`TEMPLATE.Rmd`](https://github.com/nescent/popgenInfo/tree/master/TEMPLATE.Rmd) file and move any associated data to the **data/** directory.
3. Move your vignette in `.Rmd` format into the **use/** directory.
4. Add the file to git using `git add use/yourfilename.Rmd data/yourdata.txt`.
5. Then commit this using `git commit` and add some short text describing what your file is.
4. Push to your fork and create a new pull request
1. From the command line, run `git push --set-upstream origin Your_branch_name` to push your branch to your remote fork
2. To do a pull request, navigate to your branch on GitHub. Click `Compare & review` or the pull request icon.
3. Once you have reviewed the changes, click `Create pull request`. Once the request is approved, the file will be automatically sent to a remote server that compiles the document into a html file.

## Guidelines for approval

Expand Down
16 changes: 8 additions & 8 deletions CONTRIBUTING_WITH_GIT2R.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,13 @@ that, if you change or delete that PAT, you must replace it here.

In the next step, we will ensure that our fork is up to date with NESCent. In
order to do that, we need to tell our local copy that it can take updates from
NESCent. We do this by adding NESCent as a **remote** using the function
`remote_add()` and checking to make sure it worked with the function
`remotes()`.
NESCent. We do this by adding NESCent as a **remote** called 'upstream' using
the function `remote_add()` and checking to make sure it worked with the
function `remotes()`.

```{r remote_add}
remote_add(repo,
name = "NESCent",
name = "upstream",
url = "https://github.com/NESCent/popgenInfo.git")
# Check our remotes
Expand Down Expand Up @@ -295,10 +295,10 @@ nothing will appear, but if there is new content on the master branch or new
branches on the repository, they will be downloaded and each branch will be
printed to your screen. For our purposes, we are only concerned with the changes
on the **master** branch, which will look something like this:
`## [new] b62a78c1fcd384a3ea23 refs/remotes/NESCent/master`.
`## [new] b62a78c1fcd384a3ea23 refs/remotes/upstream/master`.

```{r update_master_fetch}
fetch(repo, name = "NESCent")
fetch(repo, name = "upstream")
```

It's important to note that our local repository is still unchanged at this
Expand All @@ -307,7 +307,7 @@ repository, we should merge the changes from NESCent's master branch into our
master branch:

```{r update_master_merge}
merge(repo, "NESCent/master")
merge(repo, "upstream/master")
repo
```

Expand Down Expand Up @@ -542,7 +542,7 @@ variable called `BRANCH` that we named above.


```{r make_pull}
(my_account <- dirname(remote_url(repo, "origin")))
(my_account <- dirname(remote_url(repo, "origin")))
(pull_request_url <- paste(my_account, "popgenInfo/pull/new", BRANCH, sep = "/"))
```

Expand Down

0 comments on commit 19ef163

Please sign in to comment.