Skip to main content

Git Sync

From the workspace settings, you can set a git_repository resource on which the workspace will automatically commit and push scripts, flows and apps to the repository on each deploy.

Version Control

For all details on Version Control in Windmill, see Version Control.

This video shows how to set up a Git repository for a workspace (Git Sync - workspace mode).


Git Sync - Workspace mode

All scripts, flows and apps located in the workspace will be pushed to the Git repository, except the ones that are saved in private user folders (i.e. where the path starts with u/, use those with f/ instead). Filtering out certain sensitive folders from the sync will be available soon.

On each deployment, only the updated script/flow/app will be pushed to the remote Git repository.

This feature is Cloud & Enterprise Self-Hosted only.

Note that you can explicitly exclude (or include) specific files or folders to be taken into account with a wmill.yaml file.

Pull workspace locally

For the Git repo to be representative of the entire workspace, it is recommended to set it up using the Windmill CLI before turning this option on.

Use Windmill CLI to pull the workspace locally:

wmill sync pull

Pull workpsace

Push workspace to GitHub

Create a Git repository (in the example, on GitHub).

Run the following commands from the git repo folder to push the initial workspace content to the remote:

> git init
> git remote add origin https://github.com/username/reponame.git
> git add .
> git commit -m 'Initial commit'
> git push -u origin main

You now have your Windmill workspace on a GitHub repository. See the following section for an automated sync.

Setup in Windmill & GitHub token

In Windmill, create a git_repository resource pointing to the GitHub repository and containing a token (with Read-and-write on "Contents"). You URL should be https://[USERNAME]:[TOKEN]@github.com/[ORG|USER]/[REPO_NAME].git.

Add this resource to the workspace settings, in "Git Sync" tab and Save Git sync settings.

Git Sync Setup

And that's it! Now, all scripts, flows apps, resources, variables, schedules and resource types located in the workspace and f/ folders will be pushed to the Git repository.

You can filter on type if you don't want some items (e.g. variables) to be pushed to the Git repository.

Additionally, you can filter on path, meaning only scripts, flows and apps with their path matching one of those filters will be synced to the Git repositories below. The filters allow ''' and '**' characters, with ''' matching any character allowed in paths until the next slash (/) and '**' matching anything including slashes. By default everything in folders will be synced.

Git Sync - Item mode: Deploy to Prod using a Git Workflow

This feature can be used alongside GiHub Actions to adopt a robust development process for your Windmill scripts, flows and apps, with for example a Staging Workspace making automatically PRs on a repo that pushes to a Prod workspace upon merge.


More details at: