-
Notifications
You must be signed in to change notification settings - Fork 10
GSI User Information
Welcome to the GSI wiki! Most of the necessary information for creating branches and running the regression tests will remain on Redmine until we are able to fully work within GitHub. Please see the VLab GSI wiki for lots of good information.
There are several differences between how things were done on VLab versus GitHub. This wiki discusses GitHub specific changes.
Only a handful of people have write access to the official repository. All development will be done through personal forks. To create a fork of NOAA-EMC/GSI, simply click the Fork button on the top right corner of the page.
Please see GitHub's help guide for forking for more information.
Now that you have created your fork, it is time to clone your fork into your workspace. The GSI still requires the fix submodules under github in order to run, so you will clone the fork using the --recursive
option in order to fetch the contents of the fix submodules.
As an example, I use:
git clone --recursive [email protected]:MichaelLueken-NOAA/GSI.git
to clone my personal fork into my workspace.
Script ush/build.sh
run cmake and make to build the GSI and EnKF executables. To build the package
- cd ush
- ./build.sh
The build creates directory build. This is the directory from which ctests (regression tests) are executed. Upon successful completion build.sh places the gsi and enkf executables in directory install/bin. This directory is at the same level as ush.
You fork is a separate entity from the official repository. In order to update your fork with changes in the official repository, you will need to add a remote upstream to your local repository. To do this:
-
Add a new upstream remote, pointing to the official NOAA-EMC/GSI repository, into your cloned fork.
git remote add upstream https://github.com/NOAA-EMC/GSI
-
Use git remote -v to ensure that the new upstream is properly set. Output should be similar to
[Michael.Lueken@v72a3 ush]$ git remote -v origin [email protected]:MichaelLueken-NOAA/GSI.git (fetch) origin [email protected]:MichaelLueken-NOAA/GSI.git (push) upstream https://github.com/NOAA-EMC/GSI (fetch) upstream https://github.com/NOAA-EMC/GSI (push)
-
Use git remote update to bring in the upstream (official) repository
git remote update
-
If you aren't in master, then checkout master
git checkout master
-
Merge the upstream (official) develop to forked master
git merge upstream/develop
-
Ensure that your fix and libsrc submodules are updated
git submodule update
-
Handle potential conflicts
-
Push updated forked master to forked repository
git push origin master
-
Checkout and merge updated master to personal branch
-
Push the personal branch back to the fork.
Pull requests should be prepared similar to how code was prepared for code review on VLab:
-
Create an issue (if you haven't done so already). I will not accept changes that don't have an issue associated with them.
-
Do a squash merge of your changes into the master of your forked repository
git checkout master git merge --squash your_branch
- Commit and push
git commit -m "GitHub Issue NOAA-EMC/GSI#XX. Insert commit message here." where XX is your GitHub issue number git push origin master
- Please create the PR using the forked master
When changes are merged to the NOAA-EMC/GSI develop branch that overlap with changes that you have made in your PR, you will need to rebase the develop branch into your work (to correct conflicts between the authoritative repo and your fork). To do this:
- git remote add upstream https://github.com/NOAA-EMC/GSI.git
- git remote update
- git rebase upstream/develop
- Correct the conflicts that appear.
- git rebase --continue
- git commit --amend
- git push origin master --force