Kart Git And TUFLOW: Difference between revisions

Content deleted Content added
 
(10 intermediate revisions by 2 users not shown)
Line 3:
==Notes==
* This wiki page was written with Kart v0.12.2 which is still considered a pre-release version. Kart is in rapid development and some of the constraints and/or methods may no longer be valid or have changed in subsequent versions.
* The examples on this page use git bash (on Windows) which is installed with Git. A lot of the methodology can also be done throughtthrough Windows command prompt with the same syntax however on this version of Kart, for private remote repositories, Kart will not prompt for any authentication while using command prompt and will simply fail to push/pull. Git bash will prompt for authentication and is also easier to add and save ssh keys so is a lot better to use in these contexts. For consistency, it will be adopted for all examples over command prompt.
* The examples below have used SSH authentication with either Gitlab or Github. SSH authentication appears to be work better with Kart.
* It's a good idea to ensure you have hidden folders visible. Both Git and Kart use hidden folders to store information and it's nice being able to see them and access them if needed.
Line 12:
* Kart <b><u>[https://kartproject.org/ kartproject.org/]</u></b> - Kart will require admin privileges to install. Kart is packaged with it's own Git version, however this will not contain git bash so the above installation will be required.
Recommended software:
* QGIS with the Kart plugin (and the TUFLOW plugin for importing empty files). The page [[TUFLOW Setup with Kart QGIS Plugin|here]] describes how to set up a TUFLOW project with Kart and some of the benefits.
 
==Setting Up Git Bash==
Line 32:
<pre>
ssh-add ~/.ssh/id_ed25519
</pre>
To add have it so it will save it even after a restart, you can add the key to the keychain by adding -k
<pre>
ssh-add -k ~/.ssh/id_ed25519
</pre>
 
Line 122 ⟶ 118:
 
==Cloning an Existing Repository==
Once your model repository is setup it is desirable to be able to clone the repository so that others can work on it. The steps below outline how this can be done, it is assumed that Git Bash has been setup and configured with an SSH key and that the user has been given access to push/pull to the remote:
====1. Clone Control File Repository====
In Git Bash, change directory to where the TUFLOW model will sit (Note: bash will require forward slashes in file paths <tt>/</tt>):
<pre>
cd c:/projects
</pre>
Use <tt>git clone</tt> to clone the repo (Note: make sure to use the SSH repository address):
<pre>
git clone git@gitlab.com:ellis_symons/tutorial-model.git
</pre>
====2. Clone GIS File Repository====
Once the main project has been cloned, change directory into the model folder (where the "gis" folder will sit)
 
cd tutorial-model/model
 
Clone the kart repository assigning it the desired GPKG name (in this case the gpkg will be called "gis_database.gpkg"):
<pre>
kart.exe clone git@gitlab.com:ellis_symons/tutorial-model-gis.git gis_database
</pre>
Rename the "gis_database" folder to "gis" to match TUFLOW folder naming convention.
 
====Summary====
The steps above will copy all the input text control files (and boundary files) as well as the gis layers. The grid inputs have been excluded thus far from being versioned, this is due to their size (usually very big) and the fact that they don't often change meaning they don't typically have to be versioned. So at this point in the process any grid files will have to be copied from where they are being stored into the correct directory location.
 
==Workflow==
Once setup, the specific workflow will be dependent on how many many modellers will be working on the project concurrently and the specific goals of the project (e.g. are there going to be a lot of mitigation scenarios etc). The use of branches may be a robust approach in complex situations with a lot of mitigation options, or even a separate repository and GPKG for mitigation options.<Br>
<Br>
For the workflow, the easiest approach is to use something like Visual Studio Code for TUFLOW control file editing as this has a version control manager which will make the stage/commit/push/pull a lot easier and skips the need to be using the CLI. For kart, using the kart plugin in QGIS is the easiest method for skipping the need to use the CLI, however for pushing/pulling it may be necessary to use Git Bash to setup the SSH authentication. The TUFLOW plugin 'import empty' tool has an option to import directly into a kart repository, skipping the need to double handle the creation of TUFLOW GIS input files.