4.1. Introduction to Working with the HAFS Repository in GitHub
(Please see the Prerequisites for Working with the HAFS Repository before beginning.)
General steps to add new developments to the HAFS GitHub repository:
Fork the HAFS repository and clone the forked repository locally.
Create a feature branch from the
develop
branch to add new developments.Add developments.
Complete testing.
Commit changes into the local branch and push the local branch to your personal fork.
Submit a Pull Request (PR) to request a code review and merge new developments with the authoritative HAFS repository.
4.1.1. Fork the HAFS Repository and Clone the Forked Repository Locally
Users need a GitHub account to work with the HAFS repository. Instructions for creating an account are available on GitHub and via the Earth Prediction Innovation Center website.
Navigate to https://github.com/hafs-community/HAFS. Locate and click on the “fork” button towards the top right of the page. Users can create a fork by selecting the default settings; more advanced users may opt to alter the defaults.
Clone the newly created HAFS fork, which will copy the repository onto the user’s local system.
git clone --recursive https://USERNAME@github.com/USERNAME/HAFS.git
Users should replace
USERNAME
with their GitHub username in the command above.Hint
4.1.2. Create a Feature Branch from the develop
Branch
Check out the
develop
branch:git checkout develop
Create a new branch from the
develop
branch:git checkout -b feature/mybranch
Update the submodules:
If there are changes for the URLs of the submodules, run this command to update the remote versions of the submodules
git submodule sync --recursive
Note: every time after you clone a git repository or check out a new branch, if submodule changes are expected, you need to update the submodules properly by
git submodule update --init --recursive
Make modifications and commit changes locally:
vi NewCodeFile git add NewCodeFile git commit -m “Add newcode description”
Push changes to your GitHub HAFS fork:
git push origin feature/mybranch