Skip to content

Quick start guide for HAFS developer v1.0

Jili Dong edited this page Mar 5, 2020 · 1 revision
  1. Fork the HAFS repository:

    Navigate to https://github.com/NOAA-EMC/HAFS, locate and click on the "fork" button towards the top right of the page.

    To get the personal fork (all branches included):

    $ git clone https://[email protected]/USER/HAFS.git (remove --recursive here to avoid submodule/branch issue; recursive is done in submodule update)


  1. Check out develop branch (it is the branch recommended for developers to work on)

    $ git checkout develop

    $ git submodule update --init --recursive (update/fetch submodule: remove "--remote" which will check out the latest commit for each submodule---not always desirable)


  1. Set upstream repository for individual fork:

    $ git remote add upstream https://[email protected]/NOAA-EMC/HAFS.git

    $ git remote update (update all of your branches set to track remote ones, but not merge any changes in)

    $ git merge remotes/community/develop (merge upstream into local branch)

    $ git remote -v show

    If you want to remove the remote upstream URL:

    $ git remote rm upstream


  1. To update/modify and commit code related to vlab (fre-nctools for pre-processing, chgres, GSI, forecast, EMC_post), please see 5-6;

    To update/modify and commit code related to HAFS github repo (vortex tracker, util etc), please see 7-8.


  1. Work on HAFS branch and keep in sync with master:

    $ cd sorc/xxxx.fd

    $ git checkout HAFS

    $ git checkout -b my-feature-branch

    To keep in sync with HAFS branch

    $ git checkout HAFS

    $ git pull

    $ git checkout my-feature-branch

    $ git merge HAFS


  1. Modify code and ready to commit change to HAFS:

    $ modify code and test

    $ git add file_changed (or $ git add all)

    $ git commit -m “message”

    $ git checkout HAFS

    $ git merge my-feature-branch

    $ git push origin HAFS


  1. Work on develop branch and keep in sync with upstream:

    $ cd sorc/xxxx.fd

    $ git checkout develop

    $ git checkout -b my-feature-branch

    To keep in sync with develop branch

    $ git checkout develop

    $ git pull

    $ git checkout my-feature-branch

    $ git merge develop


  1. Modify code and ready to commit change to develop:

    $ modify code and test

    $ git add file_changed (or $ git add all)

    $ git commit -m “message”

    $ git checkout develop

    $ git merge my-feature-branch

    $ git push origin develop

    Go to github and do pull request to HAFS authoritative develop branch


Clone this wiki locally