Using git¶
For developing River Architect, the first step is to become a contributor by contacting us. For direct contact, please do not hesitate to contact us by finding prof. Greg Pasternack on the annual AGU meetings!
Using git brings many advantages for developers (nothing gets lost) and for users (consistent code). River Architect implies multiple repositories, which should be cloned and used in line with the descriptions in the Wiki for developers:
The Wiki:
https://github.com/RiverArchitect/RA_wiki.gitMedia (presentations and images):
https://github.com/RiverArchitect/Media.gitThe website hosted on GitHub pages:
https://github.com/RiverArchitect/RiverArchitect.github.io.gitThe main program (this is downloaded when clicking the
Downloadbutton on the website):https://github.com/RiverArchitect/program.gitSample data are provided with
https://github.com/RiverArchitect/SampleData.gitTemplates for developers are in
https://github.com/RiverArchitect/development.git
To download, modify and push changes to River Architect download and install Git Bash. GitHub provides detailed descriptions and standard procedures to work with their repositories (read more). The following “recipe” guides through the first time installation (cloning) of River Architect:
Open Git Bash
Type
cd "D:/Target/Directory/"to change to the target installation directory (recommended:cd "D:/Python/RiverArchitect/"). If the directory does not exist, it can be created in the system explorer (right-click in empty space >New >>Folder).Clone the repository:
git clone https://github.com/RiverArchitect/program
Now is the moment to modify the source code (e.g., modify or add new modules). After finalizing and testing (push debugged code only!) new code, go back to Git Bash and type:
git status- this shows the modifications made.If the status seems OK with the consciously made changes, type
git add .; if only single files were changed, usegit add filename.pyinstead. Best solution: use a local gitignore file.Commit changes
git commit -m "Leave a message"- leave a significant and precise short message.git pull --rebase- if locally edited scripts were modified remotely since the last pull, this will prompt issues and highlight problematic section with>>>. Manually open concerned files and resolve the issues (delete invalid>>>highlights).git push
Done. Close Git Bash.
Push only relevant files and consider using a .gitignore file. River Architect already comes with a .gitignore file that excludes .pyc (compiled bytecodes) and .log (logfiles) files. To exclude local subdirectories from git push, or directory patterns, add them as follows (replace pattern2ignore and directory2ignore with folder names):
*.pyc
*.log
**/pattern2ignore/
/directory2ignore/
Being a small developer team, we are currently not using git branching. This may change in the future …