Prepare for the GitHub workflow

Prepare for the GitHub workflow carson Mon, 03/04/2019 - 14:51

Set up your development forks

In order to submit a pull request (PR) for the code changes at a later stage, it is necessary to create a GitHub user fork of the authoritative repositories for which changes are made. For this exercise, changes are made to the umbrella repository NEMSfv3gfs and the two submodules ccpp-physics and FV3. Creating a fork is a one-off task.

  1. Navigate to http://github.com/NCAR/NEMSfv3gfs, locate and click on the the "fork" button towards the top right of the page.
  2. Navigate to http://github.com/NCAR/FV3 locate and click on the the "fork" button 
  3. Navigate to http://github.com/NCAR/ccpp-physics locate and click on the the "fork" button 

If you already forked this repository in the past, you will see a message "You've already forked NEMSfv3gfs" and a link that you can click on to get to your fork (http://github.com/YOUR_GITHUB_USERNAME/NEMSfv3gfs). Otherwise, follow the instructions to create your user fork. Repeat for ccpp-physics and FV3.

Set up the directory structure for this hands-on session and checkout the source code.  

   mkdir ${YOUR_WORK_DIR}/NEMSfv3gfs_CCPP_training
   cd ${YOUR_WORK_DIR}/NEMSfv3gfs_CCPP_training
   git clone --branch=emc_training_march_2019 --recursive https://github.com/NCAR/NEMSfv3gfs develop

Note. Potential errors while checking out the submodule NCEPLIBS-pyprodutil (e.g., "gerrit: Name or service not known") can be ignored.

At this point, you should have a directory tree named "develop" which contains sub-directories for FV3, FMS, NEMS, ccpp/physics, ccpp/framework.  Each of these contains the tag "emc_training_march_2019", as a starting point for these exercises.

Configure remotes and create branches

Next, configure the remote destinations (remotes) so that your development is pushed to your fork and not (inadvertently) to the GMTB repository at NCAR.  Also, create branches in the three repositories where changes will be made:

   cd develop
   # Submodule ccpp-physics
   cd ccpp/physics
   git remote rename origin upstream
   git remote add origin https://github.com/YOUR_GITHUB_USERNAME/ccpp-physics
   git remote -v show
   git remote update
   git checkout -b my_rftim_implementation
   cd ../../
   # Submodule FV3
   cd FV3
   git remote rename origin upstream
   git remote add origin https://github.com/YOUR_GITHUB_USERNAME/FV3
   git remote -v show
   git remote update
   git checkout -b my_rftim_implementation
   cd ../
   # Umbrella repository NEMSfv3gfs
   git remote rename origin upstream
   git remote add origin https://github.com/YOUR_GITHUB_USERNAME/NEMSfv3gfs
   git remote -v show
   git remote update
   git checkout -b my_rftim_implementation