# Patch Creation

.... intro on GitHub pull request system .....

## Fork SSG

1. Visit SSG's GitHub webpage at https://github.com/OpenSCAP/scap-security-guide. In the top-right corner, you will see a button that says "Fork." Click it.

2. If you're a member of multiple GitHub groups/accounts, you will be asked for the fork destination. For most users it is sufficient to fork into their local account. To do so, click on your username/icon. For example:

3. Congratulations, you've created a localized repository! Any changes you make will be localized, consider it your own sandbox. At this point you can 'git clone' the source over SSH, HTTPS, or Subversion.

   GitHub dynamically generates the appropriate git URLs, and dynamically generates zip-compressed archives should you desire them. In the right-most column, near the bottom, you will see the various git clone options:

## Committing to your Local Repository

... text to describe ....

### Edits via GUI

The GitHub website supports in-line editing of files. This is extremely convenient when making small changes, such as fixing typos. When you've found a file in need of edits, note the "Edit" button within the file's toolbar:

This will bring you to an in-line editor. Make your changes and scroll to the bottom of the webpage. You will notice a "Commit Changes" form. The first field is a one-line description of the change, while within the second (main body) you are expected to provide a detailed description of any changes. Your entries in this field should be as concise as possible while providing enough description for a community member to properly evaluate your changes, and the logic for making them. For example:

Click on "Commit changes," which will push the change to your local repository.

### Edits via CLI

As mentioned earlier, GitHub creates a localized git repository, your own personal sandbox. Clone the repository locally, then 'git commit' and 'git push' changes as you normally would.

## Issuing Pull Requests

When you're ready for your patches to be merged upstream, you must issue a "Pull Request."

1. Return to your local repositories webpage on GitHub.

   NOTE: If you've created local branches, ensure you've selected the appropriate branch that you'd like to submit patches against. For most people, this step can be ignored.

2. Click on "Pull Request," located in the top-right of the frame which lists your directory contents:

3. You will be brought to a listing of your commits. Click the green button labelled "Create Pull Request":

4. You will be requested to input a patch title and description. Be concise, but thorough enough for a community member to understand logic behind your changes. Paste into the description field testing evidence (e.g. running testcheck.py on any submitted OVAL, or before/after for remediation scripts).

   After completing the form, select "Send pull request":

5. A community member will review your patch. They will either merge the patch upstream, indicate additional changes/documentation needed, or decline the patch. You'll automatically be notified via EMail of any status updates.