Tutorials

Git & Versioning TIA Portal

Bring the power of software version control to industrial automation.

T
T-IA Connect Team
18 min read
Updated March 12, 2026

Automation meets DevOps

TIA Portal project files (.ap*) are opaque binary formats, impossible to compare (diff) or version properly. By using T-IA Connect to automatically export your logic to XML, you unlock the use of Git to track every change, work in teams, and ensure total traceability.

Prerequisites

  • Git installed on your engineering workstation
  • T-IA Connect (AI Pro or Enterprise edition)
  • An account on a Git platform (GitHub, GitLab, Gitea)

Step 1: Bulk XML Export

Use the API to export all your blocks (SCL, LAD, FBD) and data types to a local folder in XML format.

curl — POST /api/blocks/actions/export-all
curl -X POST http://localhost:9000/api/blocks/actions/export-all \
  -H "Content-Type: application/json" \
  -d '{
    "outputFolder": "C:\\Projects\\Machine_V1\\src",
    "format": "XML",
    "includeSubfolders": true
  }'
Output / Git
{
  "success": true,
  "exportedFiles": 156,
  "path": "C:\\Projects\\Machine_V1\\src",
  "durationMs": 12400
}

Step 2: Git Repository Initialization

Initialize a Git repository in the export folder. Create a .gitignore file to exclude temporary files and keep only useful source code.

Terminal — git init
cd C:\Projects\Machine_V1\src
git init
git add .
git commit -m "Initial export from TIA Portal"
Output / Git
Initialized empty Git repository in C:/Projects/Machine_V1/src/.git/
[master (root-commit) 4a2b3c4] Initial export from TIA Portal
 156 files changed, 124050 insertions(+)
 create mode 100644 FB_Main.xml
 ...

Step 3: Commit Workflow and Comparison

After each modification in TIA Portal, run the auto-export again. Use 'git diff' to visualize exactly which lines of code changed before committing.

Terminal — git diff
git diff FB_MotorControl.xml
Output / Git
--- a/src/FB_MotorControl.xml
+++ b/src/FB_MotorControl.xml
@@ -42,7 +42,7 @@
- <Attribute Name="Speed" Value="1500" />
+ <Attribute Name="Speed" Value="1800" />

XML versioning not only allows version comparison but also specific block restoration without re-opening a full project archive.

The End of V1, V2_final, V2_really_final archives

Adopting Git for your TIA Portal projects means choosing the rigor of software engineering applied to industry. It's the guarantee of never losing a line of code again.

Ready for industrial DevOps? Download T-IA Connect.