Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save farukterzioglu/4c60635ba4885b50cb3ebd0ab4d269ba to your computer and use it in GitHub Desktop.
Save farukterzioglu/4c60635ba4885b50cb3ebd0ab4d269ba to your computer and use it in GitHub Desktop.
Managing a btcd Pull Request for Code Contibutions

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 btcd on github

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

    $ go get -u github.com/btcsuite/btcd/...
  • Navigate to the btcd code directory

    $ cd $GOPATH/src/github.com/btcsuite/btcd
  • Add a git remote for your fork:

    $ git remote add yourname https://github.com/yourname/btcd.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/btcd

  • 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