Skip to main content
Keep your scripts in version control with bidirectional Git synchronization. Connect a GitHub or GitLab repository and sync changes in either direction.

Connecting a repository

1

Navigate to Git settings

Go to your site’s Settings > Git Integration.
2

Choose your provider

Select GitHub or GitLab and authorize GoodCraft Script to access your repositories.
3

Select a repository

Choose an existing repository or create a new one. You can also specify a subdirectory within the repository.
4

Configure sync settings

Choose your sync mode and branch settings.

Sync modes

Changes you make in the GoodCraft Script editor are pushed to your Git repository.
  • Scripts are saved as files (e.g., scripts/nav-animations.js)
  • Each save creates a commit
  • Commit messages include the script name and change summary

Repository structure

When synced, your repository contains:
your-repo/
├── scripts/
│   ├── nav-animations.js
│   ├── form-validation.js
│   └── custom-styles.css
├── components/
│   └── shared-utilities.js
└── gcscript.config.json
The gcscript.config.json file stores script metadata:
{
  "scripts": {
    "nav-animations.js": {
      "pages": ["/", "/about"],
      "priority": 1,
      "enabled": true
    }
  }
}

Webhooks

For pull-based sync, GoodCraft Script creates a webhook in your repository. When you push changes, the webhook triggers an import.

Supported events

  • Push to configured branch
  • Pull request merge

Webhook security

Webhooks are secured with a unique secret token. Each payload is verified before processing.

Best practices

Use Git integration for team collaboration and backup, but be careful with bidirectional sync if multiple people edit scripts simultaneously.
  • Use branches - Work on a development branch and merge to main when ready
  • Write commit messages - GoodCraft Script auto-generates messages, but you can customize them
  • Review before merge - Use pull requests to review script changes before they go live