Version Control with Git​Version ​Control with ​Git

Available on: >= 0.17.0

Best practices for Version Control with Git in Kestra.

By default, all Kestra flows are automatically versioned with Revisions. You don't need to use any additional version control system to track changes to your flows. Kestra automatically creates a new revision of a flow whenever you save it, and you can view the history of changes to a flow, compare changes between revisions, and restore a previous version at any time.

However, if you want to use Git to track changes to your Flows and Namespace Files, you can do so using the built-in Git support in Kestra.


There are multiple ways to use Git with Kestra:

  • The git.SyncFlows pattern allows you to implement GitOps and use Git as a single source of truth for your flows.
  • The git.SyncNamespaceFiles pattern allows you to implement GitOps and use Git as a single source of truth for your namespace files.
  • The git.PushFlows pattern allows you to edit your flows from the UI and regularly commit and push changes to Git; this pattern is useful if you want to use the built-in Editor in the UI and still have your code in Git.
  • The git.PushNamespaceFiles pattern allows you to edit your namespace files from the UI and regularly commit and push changes to Git; this pattern is useful if you want to use the built-in Editor in the UI and still have your files in Git.
  • The CI/CD pattern is useful if you want to manage the CI/CD process yourself e.g. via GitHub Actions or Terraform, and keep Git as a single source of truth for your code.

The image below shows how to choose the right pattern based on your needs:

git

For a detailed comparison of the three patterns, check the Version Control with Git page.

Was this page helpful?