GIT usage for developers¶
Currently useful branches for SURFEX-Crocus developers¶
cen: last stable release of the Crocus code (recommended for simple users)
cen_hotfix: branch dedicated to publish bug fixes
cen_dev: branch for new developments (recommended for all developers)
Create your own branch¶
go on cen_dev branch:
git checkout cen_dev
make your own LOCAL branch with the following naming convention (this branch might be push on the distant repository, but mainly in the case of multiple developers on the same development)
git branch cen_dev_your_project_name
Only consistent developments should be commited after the finalization of a new functionality (including tests)
Merge regularly (each month) distant cen_dev branch in your LOCAL branch¶
git checkout cen_dev_your_project_name git merge origin/cen_dev
You may have conflicts but merging regularly allows you to not have too much work when you'll push your devs in cen_dev branch
Code versions corresponding to publications should always be merged with the last release of cen_dev.
None contribution can be incorporated in the main code if not merged with the last release of cen_dev.
The way we see commits for our developments:¶
Before a commit, please check that the compilation of the code is OK
Before a commit, please check that the test test_dev_surfex.py in snowtools/tests is OK
Please write meaningful commit message
Tag your commit before submitting a scientific publication of your development:
git tag project-vx.y
(x.y incremental version number)
List of useful command¶
Change branch
git checkout branch_name
Store your devs (before changing branch for example)
git stash
Restore your devs
git stash pop
Actualize your branch cen from distant repository
git checkout cen git pull
Merge a distant repo in your devs
git checkout branch_of_your_dev git merge origin/branch_of_interest
to be continued...