Skip to content

Submitting a pull request

Brian Pan edited this page Feb 18, 2017 · 7 revisions

You've made changes and you've tested them locally on your computer using 'docker-compose up'. Now you are ready to submit a pull request. Here's how to do it!

Creating a pull request if you have push privileges

If you have been invited to be a member of the GitHub team, then you should be able to push directly to the politicalrev GitHub repo. If not, you can still create a pull request; see below for instructions on forking the repo.

  1. Commit your changes to your local repo on a new branch using git.
  2. Push your new branch using git.
  3. Create a pull request on the GitHub website:
    • Go to the Pull Requests tab and click the New Pull Request button.
    • The base will be master and the compare will be the name of your new branch.
    • Add a title and description that describes the changes in your pull request.
    • Click 'Create pull request'.

Travis CI will automatically build your pull request and Github will post to our slack channel letting everyone know a pull request has been submitted. A team lead will review your changes (probably @smona or @innovativedmm).

If there are comments and you need to make additional changes, commit more changes to your branch locally and push them to GitHub. Your new commits will automatically be reflected in your pull request. When the pull request is ready, it will be merged and you should be able to see your changes in the staging environment: https://staging.political-revolution.com/

Thanks for contributing! If you need help or have any questions, ask on one of the dev Slack channels!

Forking the repository and creating a pull request

If you don't have push privileges, you can still contribute pull requests by forking the repository in GitHub. Forking creates a new copy of the repository under your own account. From a git perspective, the new repo will be unconnected to the politicalrev repo. But GitHub keeps track of forked repositories, and you can create a GitHub pull request across forks.

  1. Fork the repo by clicking the 'Fork' button at the top right of the GitHub repo page.
  2. Clone your fork to your local machine.
  3. When you fetch or pull, you can bring in changes from the upstream repository with:
    • 'git fetch upstream'
    • Or 'git pull upstream <branch>'
  4. Make your changes, test, and commit to a new branch using git.
  5. Push your branch using git (to your forked repo in GitHub).
  6. Create a pull request on the GitHub website:
    • Go to the Pull Requests tab and click the New Pull Request button.
    • On the left, the base fork should be politicalrev/political-revolution.com and base should be master.
    • The head fork will be <your account>/political-revolution.com and compare will be the name of your new branch.
    • Add a title and description that describes the changes in your pull request.
    • Click 'Create pull request'.

A team lead will review your changes (probably @smona or @innovativedmm), merge them, and after Travis CI automatically deploys your changes, you'll be able to see it in action in the staging environment: https://staging.political-revolution.com/

Thanks for contributing! If you need help or have any questions, ask on one of the dev Slack channels!