Skip to content

Latest commit

 

History

History
97 lines (77 loc) · 4.48 KB

CONTRIBUTING.md

File metadata and controls

97 lines (77 loc) · 4.48 KB

How to Contribute

We use the Gitflow workflow to make our lives easier. This means all edits should be made in separate branches -- not the master branch. Only the project maintainer will make edits or merge on master.

View the open issues to see the To-Do list. If an issue isn't assigned to anyone, we would welcome your contribution!

If you need a refresher on Git or GitHub, see:

Contributing changes

  1. Either clone or fork this repo.

    • clone if you have write access:

      git clone https://github.com/SchlossLab/ML_pipeline_microbiome
      

      (All Schlabbies have write access.)

    • fork if you do not have write access by pressing the Fork button on GitHub, then clone your fork.

  2. Move to the repo directory.

    cd ML_pipeline_microbiome
    
  3. Create a new branch for your feature.

    Give it a short, descriptive name.

    git checkout -b feature-branch-name
    

    The branch name should reflect the bug or feature it will resolve, or reference the issue number directly (examples). [Note: wherever you see feature-branch-name in these instructions, replace that with your branch's actual name.]

  4. Make your edits.

  5. Add & commit changes.

    git add filename.R
    git commit -m "Implement cool feature XX (Resolves #Y)"
    

    Use this style guide for writing good commit messages. The highlights:

    • Capitalize the first word of the message.
    • The first word should be a verb in the imperative tense.
    • Keep the message short but descriptive of the changes.

    In the merge commit message, reference any issues (our To-Do list) that the pull request resolves so the issue is closed automatically. For example, the commit message I wrote when adding this file was Add contributing instructions (Resolves #12).

  6. Push your branch to GitHub. If you're pushing your branch for the first time, you'll have to set the upstream:

    git push --set-upstream origin feature-branch-name
    

    Otherwise, just push like usual:

    git push origin feature-branch-name
    

    If you forget the branch name:

    • Run git status to see the branch you currently have checked out (among other things).
    • You can list existing branches with git branch --list.
  7. Open a pull request [example].

    1. If you made multiple commits over a period of time, chances are high that your branch is behind the master branch. Follow these instructions to bring your local branch up to date with master on both your local and remote repository, run:
      git checkout master
      git pull
      git checkout feature-branch-name
      git merge master
      git push
      
    2. Open the repo page in your web browser.
    3. If you want to see what the modifications look like before opening a pull request, you can go to the document you modified and change the branch to the left of the file name.
    4. Go to the pull requests tab and click new pull request.
    5. Select your branch name to compare to master. If you forked the repo instead of making a branch, select compare across forks instead.
    6. Create the pull request.

    A maintainer will review your pull request and may ask you to make additional changes. If you have write access to the repo, don't merge your branch into master. The maintainer will merge it when they decide the branch is ready.

  8. Continue to pull, commit, & push changes on your branch to update the open pull request as needed.

  9. Once a pull request is merged, the maintainer may delete the branch if it will no longer be needed in the future.