|
| 1 | +Thank you for your interest in contributing to COSMOS! We welcome contributions and appreciate your help in making this project better. Please follow the guidelines below to ensure a smooth contribution process. |
| 2 | + |
| 3 | +## Pull Requests |
| 4 | + |
| 5 | +### Prerequisites |
| 6 | + |
| 7 | +- **GitHub CLI (`gh`)**: Make sure you have the GitHub CLI installed. If not, you can install it from [GitHub CLI installation page](https://cli.github.com/). |
| 8 | + |
| 9 | +### 1. **Create an Issue on the Repo** |
| 10 | + |
| 11 | +1. **Navigate to Your Repository**: |
| 12 | + |
| 13 | + ```bash |
| 14 | + $ cd path/to/your/repository |
| 15 | + ``` |
| 16 | + |
| 17 | +2. **Create an Issue**: |
| 18 | +Use the `gh issue create` command to create a new issue. |
| 19 | + |
| 20 | + ```bash |
| 21 | + $ gh issue create --title "Issue Title" --body "Description of the issue" |
| 22 | + ``` |
| 23 | + |
| 24 | + After running this command, you’ll get an issue number in the output. Note this number as it will be used to create a branch. |
| 25 | + |
| 26 | + |
| 27 | +### 2. **Create a Branch for the Issue** |
| 28 | + |
| 29 | +1. **Create a Branch**: |
| 30 | +Use the `gh` CLI to create a branch associated with the issue. The `gh` CLI can automatically create a branch for you based on the issue number. In this case, the `<issue_number>` is 989. |
| 31 | + |
| 32 | + ```bash |
| 33 | + $ gh issue develop -c 989 |
| 34 | + github.com/NASA-IMPACT/COSMOS/tree/989-make-coding-syntax-consistent |
| 35 | + From https://github.com/NASA-IMPACT/COSMOS |
| 36 | + * [new branch] 989-make-coding-syntax-consistent -> origin/989-make-coding-syntax-consistent |
| 37 | + |
| 38 | + ``` |
| 39 | + |
| 40 | + This command creates a new branch named `<issue_number>-issue` and switches to it. This branch will be used to work on the issue. |
| 41 | + |
| 42 | +2. **Make Your Changes and Push:** |
| 43 | +Edit files, add code, or make any changes needed to address the issue. Commit your changes and push the branch to the remote repository. |
| 44 | + |
| 45 | + ```bash |
| 46 | + git add . |
| 47 | + git commit -m "Fixes issue #<issue_number>" |
| 48 | + git push origin <issue_number>-issue |
| 49 | + ``` |
| 50 | + |
| 51 | + |
| 52 | +### 3. **Create a Pull Request** |
| 53 | + |
| 54 | +1. **Create the Pull Request**: |
| 55 | +After pushing the branch, create a pull request using the `gh pr create` command: |
| 56 | + |
| 57 | + ```bash |
| 58 | + gh pr create --base dev --head <issue_number>-issue --title "Title of the Pull Request" --body "Description of the changes" |
| 59 | + ``` |
| 60 | + |
| 61 | + - **`-base`**: The base branch you want to merge your changes into (`dev` in our case) |
| 62 | + - **`-head`**: The branch that contains your changes (e.g., `<issue_number>-issue`). |
| 63 | + - **`-title`**: The title of the pull request. |
| 64 | + - **`-body`**: The description or body of the pull request. |
| 65 | + |
| 66 | + This command will create a pull request from your branch into the base branch specified. |
| 67 | + |
| 68 | +2. **Review and Merge**: |
| 69 | +Once the pull request is created, you can review it on GitHub and merge it if everything looks good. |
0 commit comments