Ignition 8.3’s file-based project structure makes it much easier to use standard Git workflows with SCADA projects. Project resources can now be version-controlled directly as files, which makes branch switching, pull requests, and external editing more practical. This also enables patterns such as using symbolic links to share project resources across environments.
One issue that arises with this workflow is that Ignition does not always immediately detect file changes made outside the Designer. After checking out a branch, merging changes, or pulling updates, the gateway will still need a manual file scan from the Gateway before the latest project or configuration files are reflected.
To make development workflows smoother for our projects at DMC, we created a script that uses the Ignition 8.3 Gateway API endpoints to trigger project and configuration file scans. By integrating this script into Git hooks, file scans can run automatically after branch checkouts or merges, eliminating the need to manually navigate to the Gateway webpage and trigger them each time (fig1 and fig2). Additionally, developers can manually run the script from Bash or the command line to trigger file scans on demand.
In this blog, we have provided a sample script and .env file, and we will walk you through the steps to set this up.


Why This Step Matters
There are a variety of reasons why automating this step is both important and beneficial. This automation reduces friction in the development workflow, reducing some of the common sources of errors and delays while improving team-wide consistency and clarity. By using Git hooks to automate file syncing in Ignition, developers avoid repeated trips to the Gateway UI and reduce mental load.
By adding automated file scans into the development workflow, teams can make Ignition 8.3 development feel more like regular software development, where Git-based practices like branching, merging, and pull requests fit naturally into SCADA projects.
Set Up Gateway API Key
In order to access the API endpoint, we need to set up an API key in the Gateway. Follow Ignition’s manual for this.
By default, Ignition requires API keys to be used over secure HTTPS connections. Since this script commonly runs against local development Gateways using standard HTTP, the Require secure connections for API Keys setting must be disabled for the requests to succeed.
Make sure to copy the ENTIRE api key. We will add it to the .env file in the next section.
Repo and Environment Variables Set Up
Copy the example script (included in the section below) into your desired location in your repo. For example, in this repo, we have put it at the following location and called it gateway_scan.py.
Path: ignition-docker-8-3\scripts\gateway_scan

Next, add the following variables to your .env file:
GATEWAY_IP= (your gateway’s IP address)
HTTP_PORT = (your gateway’s port)
GATEWAY_API_TOKEN=(your generated API token for the gateway)
The example script looks for these variables; if they are already in your .env and are named differently, open the example script and do a find-and-replace to update the variable names.
Git Hook Set Up
Git hooks let us automatically run scripts when certain Git actions occur. For this workflow, we typically set up Git hooks to run the gateway_scan.py script after branch checkouts and merges.
This means that when a developer switches branches, pulls changes, or merges updates, the Gateway file scan can run automatically without having to open the Gateway webpage and manually trigger it.
To set this up, create two files in the .git/hooks folder:
.git/hooks/post-checkout
.git/hooks/post-merge
Paste the following code into both files:
#!/bin/sh
# Move to the root of the git repository
cd "$(git rev-parse --show-toplevel)" || exit 1
# Run file scan script
py scripts/gateway_scan/gateway_scan.pyThe post-checkout hook runs after switching branches. The post-merge hook runs after a merge, which also commonly happens when pulling new changes from the remote repository.
The first command moves the terminal to the root of the Git repository. This helps ensure the script runs from the correct location, even if Git triggers the hook from within the repository.
The second command runs the Gateway scan script:
py scripts/gateway_scan/gateway_scan.py
Developers can also run this command manually from Bash or the command line whenever they want to trigger a Gateway file scan on demand.
If the repository contains multiple gateways you want to automatically file scan for, add a separate set of environment variables for each gateway in the .env file, create an API key for each gateway, and then update the gateway_scan.py script following the comments, so the script knows which gateways to scan.
Example Script & env. File
"""
Run script to trigger file scans for Gateways.
"""
import os
from pathlib import Path
from urllib import error, request
REQUEST_TIMEOUT_SECONDS = 5
print("Syncing Ignition Gateway...", flush=True)
def load_env_file(env_path):
"""
Load simple KEY=value pairs from a .env file without third-party
dependencies.
"""
if not env_path.exists():
return
for line in env_path.read_text(encoding="utf-8").splitlines():
line = line.strip()
if not line or line.startswith("#") or "=" not in line:
continue
key, value = line.split("=", 1)
os.environ.setdefault(key.strip(), value.strip().strip("\"'"))
# Read in .env file
load_env_file(Path(__file__).resolve().parents[2] / ".env")
# Grab environment variables from the .env file.
#
# If this script only scans one gateway, these three variables are enough:
# HTTP_PORT
# GATEWAY_IP
# GATEWAY_API_TOKEN
GATEWAY_PORT = os.getenv("HTTP_PORT")
GATEWAY_IP = os.getenv("GATEWAY_IP")
GATEWAY_API_TOKEN = os.getenv("GATEWAY_API_TOKEN")
# Add additional gateway environment variables here if needed.
#
# Example:
# EDGE_PORT = os.getenv("EDGE_HTTP_PORT")
# EDGE_GATEWAY_IP = os.getenv("EDGE_GATEWAY_IP")
# EDGE_GATEWAY_API_TOKEN = os.getenv("EDGE_GATEWAY_API_TOKEN")
# Define which gateways this script should scan.
#
# To scan additional gateways, add another entry to this dictionary using the
# environment variables loaded above.
#
# Example:
# gateways = {
# "Ignition": {
# "ip": GATEWAY_IP,
# "port": GATEWAY_PORT,
# "token": GATEWAY_API_TOKENConclusion
Automating file syncs in Ignition 8.3 is a simple configuration change that can deliver meaningful improvements to your development workflow. By reducing manual steps and ensuring the Gateway always reflects the latest project state, teams can work more efficiently and with greater confidence. For engineers using Git to manage their Ignition projects, this approach unlocks the full benefits of modern version control while keeping SCADA development reliable and consistent.
Starting an Ignition project? DMC can help you take the next step.
Find out more about our Manufacturing Automation and SCADA programming solutions and reach out to an expert today.







