Skip to content

Instantly share code, notes, and snippets.

@davecgh
Created June 7, 2018 20:06
Show Gist options
  • Save davecgh/c2a5ab668f64e7fae1451df096f4db92 to your computer and use it in GitHub Desktop.
Save davecgh/c2a5ab668f64e7fae1451df096f4db92 to your computer and use it in GitHub Desktop.

Initial Preparation

The first step is to read the Code Contribution Guidelines documentation to get a good understanding of policies used by the project.

Once that is done, the following commands illustrate a straight forward setup for submitting pull requests to the project:

One time setup

  • Fork dcrd on github

  • Run the following commands to obtain dcrd, all dependencies, and install it (this has probably already been done):

    $ git clone https://github.com/decred/dcrd $GOPATH/src/github.com/decred/dcrd
    $ cd $GOPATH/src/github.com/decred/dcrd
    $ dep ensure
    $ go install . ./cmd/...
  • Add a git remote for your fork:

    $ git remote add yourname https://github.com/yourname/dcrd.git

Creating a new feature pull request

  • Checkout a new feature branch to house the changes you will be making:

    $ git checkout -b feature_branch
  • Make whatever changes are necessary for the feature and commit them

  • Push your feature branch to your fork:

    $ git push yourname feature_branch
  • With your browser, navigate to https://github.com/yourname/dcrd

  • Create a pull request with the github UI

Rebasing one of your existing pull requests

Sometimes you will be requested to rebase and squash the pull request to the latest master branch.

  • Make sure the master branch is up-to-date:

    $ git checkout master
    $ git pull
  • Checkout the existing feature branch and rebase it with the interactive flag:

    $ git checkout feature_branch
    $ git rebase -i master
  • Follow the directions presented to specify 's' meaning squash for the additional commits

  • Force push the branch to your fork:

    $ git push -f yourname feature_branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment