Best Practices
Sharing Project as a Git Repository
Git is a version control system that is handy for sharing Spine Toolbox projects.
Just add a .gitignore file to the project root (more of that later),
turn the project directory into Git repository
and push the repository to the cloud.
.gitignore File
It is recommended to exclude user’s local settings such as database credentials from the Git repository
by adding the following line to the .gitignore file:
.spinetoolbox/local/
The item directories in <project dir>/.spinetoolbox/items/ usually contain temporary
result files and/or logs, so you may want to exclude those directories as well.
Toolbox will recreate the required directories when the project is opened,
so they need not be in the repository.
If the item directories do not contain any static data such as SQLite databases
or files in the item directories of Data Connections,
it may make sense to exclude the entire items/ directory with the following line in .gitignore:
.spinetoolbox/items/
Authoring a Project
Just make sure you are in Author mode (by default you are, see Project Settings) before saving the project, then commit your changes and push.
“Consuming” a Shared Project
Usually, you try to avoid modifying any files in the repository
when working with a project someone else has authored.
This is to avoid merge conflicts when pulling latest changes to the project from Git.
Being in Consumer mode (see Project Settings) helps here:
in the mode, project.json file is never overwritten.
Note
Consumer mode is still under development and it does not track all changes to the project. The untracked changes will be lost when the project is closed.