Synchronizes the code for namespace files and flows based on the current state in Git.

Replaced by SyncFlows and SyncNamespaceFiles. Files located in gitDirectory will be synced with namespace files under namespaceFilesDirectory folder. Any file not present in the gitDirectory but present in namespaceFilesDirectory will be deleted from namespace files to ensure that Git remains a single source of truth for your workflow and application code. If you don't want some files from Git to be synced, you can add them to a .kestraignore file at the root of your gitDirectory folder — that file works the same way as .gitignore.

If there is a _flows folder under the gitDirectory folder, any file within it will be parsed and imported as a flow under the namespace declared in the task. It's important to keep in mind that all flows must be located within the same directory without any nested directories. If you want to deploy all flows to kestra from Git using the Git Sync pattern, you have to place all your flows in the _flows directory. Adding namespace folders will result in an error and that's expected. Flows are not equivalent to Namespace Files — while Namespace Files can be stored in arbitrarily nested folders stored in Internal Storage, Flows are just metadata. Flows are sent to Kestra's API and stored in the database backend. This is why they follow a different deployment pattern and cannot be stored in nested folders in Git.

Another important aspect is that the namespace defined in the flow code might get overwritten (!) if the namespace defined within Git doesn't match the namespace or a child namespace defined in the Git Sync task. All Git deployments, both the Git Sync and Kestra's CI/CD integrations, operate on a namespace level to ensure namespace-level governance of permissions, secrets, and to allow separation of resources. If you leverage multiple namespaces in a monorepo, you can create multiple flows, each using the Git Sync task to sync specific Git directories to the desired namespaces.

yaml
type: "io.kestra.plugin.git.Sync"