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:
-
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
-
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
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