28 | | Here is how a pull request works for a Boost library: |
| 28 | The simplest way to create a pull request is to fork a single library's repo. You'll have to manually check out your fork every time you update or clone the super project, but this is generally less work than forking the super project yourself. Here's how to do that: |
| 29 | |
| 30 | 1. If you haven't already done so, create a local clone of the boost tree: |
| 31 | `git clone --recursive git@github.com:boostorg/boost.git boost` |
| 32 | 2. Go to the !GitHub page for the library's repo, and fork it. |
| 33 | 3. Copy the ssh url for the forked library from the right hand side of the web page. |
| 34 | 4. Add it as a remote to your local repo: |
| 35 | `git remote add myremote ''ssh_url''` |
| 36 | 5. Now you have two remotes: `origin` for the repo in the `boostorg` organisation, |
| 37 | `myremote` for your clone. |
| 38 | 6. Create a branch for your changes: `git checkout origin/develop -b changes`. |
| 39 | 7. Push to your fork: `git push --set-upstream myremote changes`. |
| 40 | |
| 41 | Now you can create pull requests from the github page for your fork. Be careful to create it for the correct branches. |
| 42 | |
| 43 | When you update the super project it will switch you back to the branch from boostorg. It's generally easiest to just checkout your branch when you need it, but if you want to have it always checked out, you can create a local branch of the super project: |
| 44 | |
| 45 | 1. Go to the root of the super project. |
| 46 | 2. Create a branch: `git checkout origin/master -b updated`. |
| 47 | 3. Edit `.gitmodules` and change the relative url for your module to your fork's ssh url. |
| 48 | 4. Commit your changes to `.gitmodules`: `git add .gitmodules && git commit`. |
| 49 | 5. When you update the module, commit those changes to the super project as well. For example, for Boost.Utility: |
| 50 | `git add libs/utility && git commit`. |
| 51 | 6. You can merge updates from the boost repo using `git pull` - there might be conflicts if the module has been updated on `boostorg`. |
| 52 | |
| 53 | Unfortunately, if you fork the super project on !GitHub, the other modules won't work, as they're still using relative urls. |
| 54 | To avoid this you can edit the `.gitmodules` to use absolute urls - see below for details. |
| 55 | Alternatively, a user can clone the super project from `boostorg/boost`, and then add your fork as a remote and pull from that, so that the `origin` remains the `boostorg` repo. |
| 56 | |
| 57 | === Forking the super project === |