|
| 1 | +# USING THE GIT REPOSITORY |
| 2 | + |
| 3 | +## Setup your own public github repository |
| 4 | + |
| 5 | +Your first step is to establish a public repository from which i can pull your work into the master repository. |
| 6 | + |
| 7 | + 1. Setup a GitHub account (http://github.com/), if you haven't yet |
| 8 | + 2. Fork the BlockchainWalletApi repository (http://github.com/sandrokeil/BlockchainWalletApi) |
| 9 | + 3. Clone your fork locally and enter it (use your own GitHub username in the statement below) |
| 10 | + |
| 11 | + ```sh |
| 12 | + % git clone git@github.com:<username>/BlockchainWalletApi.git |
| 13 | + % cd BlockchainWalletApi |
| 14 | + ``` |
| 15 | + |
| 16 | + 4. Add a remote to the canonical BlockchainWalletApi repository, so you can keep your fork |
| 17 | + up-to-date: |
| 18 | + |
| 19 | + ```sh |
| 20 | + % git remote add upstream https://github.com/sandrokeil/BlockchainWalletApi.git |
| 21 | + % git fetch upstream |
| 22 | + ``` |
| 23 | + |
| 24 | +## Keeping Up-to-Date |
| 25 | + |
| 26 | +Periodically, you should update your fork to match the canonical BlockchainWalletApi repository. we have |
| 27 | +added a remote to the BlockchainWalletApi repository, which allows you to do the following: |
| 28 | + |
| 29 | +```sh |
| 30 | +% git checkout master |
| 31 | +% git pull upstream master |
| 32 | +- OPTIONALLY, to keep your remote up-to-date - |
| 33 | +% git push origin |
| 34 | +``` |
| 35 | + |
| 36 | +If you're tracking other branches -- for example, the "develop" branch, where new feature development occurs -- |
| 37 | +you'll want to do the same operations for that branch; simply substitute "develop" for "master". |
| 38 | + |
| 39 | +## Working on BlockchainWalletApi |
| 40 | + |
| 41 | +When working on BlockchainWalletApi, we recommend you do each new feature or bugfix in a new branch. This simplifies the |
| 42 | +task of code review as well as of merging your changes into the canonical repository. |
| 43 | + |
| 44 | +A typical work flow will then consist of the following: |
| 45 | + |
| 46 | + 1. Create a new local branch based off your master branch. |
| 47 | + 2. Switch to your new local branch. (This step can be combined with the previous step with the use of `git checkout -b`.) |
| 48 | + 3. Do some work, commit, repeat as necessary. |
| 49 | + 4. Push the local branch to your remote repository. |
| 50 | + 5. Send a pull request. |
| 51 | + |
| 52 | +The mechanics of this process are actually quite trivial. Below, we will create a branch for fixing an issue in the tracker. |
| 53 | + |
| 54 | +```sh |
| 55 | +% git checkout -b 3452 |
| 56 | +Switched to a new branch '3452' |
| 57 | +``` |
| 58 | +... do some work ... |
| 59 | + |
| 60 | +```sh |
| 61 | +% git commit |
| 62 | +``` |
| 63 | +... write your log message ... |
| 64 | + |
| 65 | +```sh |
| 66 | +% git push origin HEAD:3452 |
| 67 | +Counting objects: 38, done. |
| 68 | +Delta compression using up to 2 threads. |
| 69 | +Compression objects: 100% (18/18), done. |
| 70 | +Writing objects: 100% (20/20), 8.19KiB, done. |
| 71 | +Total 20 (delta 12), reused 0 (delta 0) |
| 72 | +To ssh://git@github.com/sandrokeil/BlockchainWalletApi.git |
| 73 | + g5342..9k3532 HEAD -> master |
| 74 | +``` |
| 75 | + |
| 76 | +You can do the pull request from github. Navigate to your repository, select the branch you just created, and then |
| 77 | +select the "Pull Request" button in the upper right. Select the user "sandrokeil" as the recipient. |
| 78 | + |
| 79 | +### What branch to issue the pull request against? |
| 80 | + |
| 81 | +Which branch should you issue a pull request against? |
| 82 | + |
| 83 | +- For fixes against the stable release, issue the pull request against the "master" branch. |
| 84 | +- For new features, or fixes that introduce new elements to the public API |
| 85 | + (such as new public methods or properties), issue the pull request against the "develop" branch. |
| 86 | + |
| 87 | +## Branch Cleanup |
| 88 | + |
| 89 | +As you might imagine, if you are a frequent contributor, you'll start to get a ton of branches both locally and on |
| 90 | +your remote. |
| 91 | +
|
| 92 | +Once you know that your changes have been accepted to the master repository, we suggest doing some cleanup of these |
| 93 | +branches. |
| 94 | +
|
| 95 | + - Local branch cleanup |
| 96 | +
|
| 97 | + ```sh |
| 98 | + % git branch -d <branchname> |
| 99 | + ``` |
| 100 | +
|
| 101 | + - Remote branch removal |
| 102 | +
|
| 103 | + ```sh |
| 104 | + % git push origin :<branchname> |
| 105 | + ``` |
| 106 | +
|
| 107 | +
|
| 108 | +## FEEDS AND EMAILS |
| 109 | +
|
| 110 | +RSS feeds may be found at: |
| 111 | +
|
| 112 | +`https://github.com/sandrokeil/BlockchainWalletApi/commits/<branch>.atom` |
| 113 | +
|
| 114 | +where <branch> is a branch in the repository. |
| 115 | +
|
| 116 | +To subscribe to git email notifications, simply watch or fork the BlockchainWalletApi repository on GitHub. |
0 commit comments