This guide will walk a developer through the correct process for making a Pull Request in this repository. GFDL_atmos_cubed_sphere is a repository with 4 different development branches. It is imperitive that the developer understands the difference between each branch.
There are 4 different development branches being supported in this repository.
Branch | Description |
---|---|
main | This branch is the main development branch. The SHiELD model will compile with this branch. When there is a Public Release of the FV3 Dyncamical Core, updates will first be introduced to this branch. |
dev/gfdl | This branch is used for all AM4 based GFDL Models. |
dev/emc | This branch is used for the UFS Weather Model development. |
dev/gfdl_am5 | This branch is being used for GFDL AM5 development. |
-
Create a Fork
- Click on Fork in the top right of the repository GitHub page
- The Owner should be set to your GitHub username
- The Repository Name should be GFDL_atmos_cubed_sphere
- Click Create fork
-
Create an Issue describing the change that you would like to implement.
- Navigate to the Issue tab at the top of the repository GitHub page
- Click on the New issue button
- Choose from one of the suggested templates (Bug Report, Feature Request, or Support Request)
- Fill out the Issue with specifics and submit issue
-
Clone the repository locally on your machine
git clone https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere.git
-
Add your fork locally
This guide will refer to the fork as
myFork
, but you can name this anything.git remote add myFork https://github.com/<username>/GFDL_atmos_cubed_sphere.git
git remote -v
will display all remote repositories that you have added. The repository that you cloned will be namedorigin
by default.The ouput of
git remote -v
should be similar to:myFork https://github.com/<username>/GFDL_atmos_cubed_sphere.git (fetch) myFork https://github.com/<username>/GFDL_atmos_cubed_sphere.git (push) origin https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere.git (fetch) origin https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere.git (push)
-
Checkout the branch that you would like your changes added to
Refer to section Understanding the Development Branches to choose which branch to checkout
This guide will reference this branch as
baseBranch
git checkout baseBranch
-
Create a feature branch to make your changes to
This guide will refer to this new branch as
newBranch
, but you should name this branch with a unique name related to the taskgit checkout -b newBranch
-
Update the code
-
To see the files you have modified use the command
git status
-
To see exactly what you changed in each file use the command
git diff
-
When you are satisfied with your changes stage them for a commit
git add <filenames or paths of all added and modified files>
-
Make a commit
git commit -m "Descriptive message describing what you have changed in this commit"
-
Make sure branch is up to date with the base branch (main, dev/gfdl, dev/emc, or dev/gfdl_am5)
git fetch origin baseBranch
git merge origin/baseBranch
-
Push that commit to your fork
git push myFork newBranch
-
-
Create a Pull Request
-
Navigate to your fork on GitHub
The URL to get you to your fork should be
https://github.com/<username>/GFDL_atmos_cubed_sphere
-
Navigate to the Pull requests tab at the top of the repository GitHub page
-
Click on the New pull request button
-
The base repository should be NOAA-GFDL/GFDL_atmos_cubed_sphere
-
The base branch is the branch you would like to add your changes to
Refer to section Understanding the Development Branches
This is the same branch that you originally checked out in Step 5 of this guide that was referred to as
baseBranch
-
The head repository should be your fork (e.g. <username>/GFDL_atmos_cubed_sphere)
-
The compare branch is the feeature branch containing your updates. This was referred to as
newBranch
in this guideYou should now see a comparison of the two branches
-
Click on the Create pull request button
-
Fill in the details of the Pull request, being sure to follow the template provided:
-
Provide a desciption: Include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
-
Link the Issue from Step 2 by including a line
Fixes #123
where 123 is the Issue # -
Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration (e.g. compiler, OS). Include enough information so someone can reproduce your tests.
-
Ensure that all checkboxes are populated. If something does not apply, please check it and note that it does not apply somewhere in the PR. If you have not completed an item in the checklist, the PR will not be merged.
To check a box replace the space in
[ ]
with an x[x]
-
Click on the Create pull request button.
-
-
Code managers will assign reviewers to the PR. If you would like someone specific to review your PR please leave a comment on the PR requesting that. When all reviewers approve the code, a code manager will merge the code and your changes will now be in the relevant development branch.
-