Skip to content

Git for TIA Portal & PLC Code

On this page

AnyAutomation Studio includes the built-in Git support of its editor foundation. Version control runs through the Source Control view rather than a separate window, so you stage, commit, and sync changes without leaving the workbench. Open a folder that is a Git repository and Source Control activates automatically.

Source Control View

Open the Source Control view from the Activity Bar (the vertical icon strip on the far left) or with Ctrl+Shift+G. The view lists every change in the open repository and is where you do most day-to-day Git work.

The Activity Bar icon shows a small count badge whenever the repository has pending changes, so you can see at a glance that there is work to commit.

Opening a Repository

Source Control follows the folder you have open in the workbench:

  1. Open the folder of your project with File → Open Folder (Ctrl+K Ctrl+O)
  2. If the folder is a Git repository, the Source Control view populates automatically
  3. If the folder is not yet a repository, the Source Control view offers Initialize Repository

You can also clone a repository: open the Command Palette (Ctrl+Shift+P) and run Git: Clone, then provide the repository URL and a target folder.

Staging and Committing

The Source Control view groups your changes into Staged Changes and Changes (unstaged).

  • Hover a file and click the + icon to stage it, or stage every change with the + on the Changes group header
  • Click the − icon to unstage a file
  • Each file shows a single-letter status indicator: M (modified), A (added), D (deleted), U (untracked), R (renamed)
  • Type your commit message in the message box at the top of the view
  • Click the Commit checkmark (or press Ctrl+Enter in the message box) to commit the staged changes

If nothing is staged when you commit, the editor offers to commit all changes. Use the ... (More Actions) menu at the top of the view for related commands such as Commit All, Commit Staged (Amend), and Stash.

Filtering the Changes

Each group header in the Source Control view, for example Changes or Staged Changes, shows a filter icon as its first icon. Click it and type part of a file name: the list shows only the changes whose name matches. Click the filter icon again to close the filter and see all changes. You can also run Source Control: Filter Changes from the Command Palette (Ctrl+Shift+P).

Importing Changes into TIA Portal

While Studio is connected to a TIA project, every change in the Source Control view shows an Import to TIA Portal icon as its first icon. Click it to import the changed file into the connected project. The import works exactly like Import Selected in the Import / Export view: you pick the target PLC where needed, files of classic HMI devices go to their device, and protected items stay unchanged.

The same command is in the context menu of a change (right-click > Import to TIA Portal). To import several changes at once, select them in the list (Ctrl or Shift click) and click the icon on one of the selected rows, or pick the command from the context menu of a selected row. Deleted files are left out, and so are files of a type the import does not take (for example a README.md) and WinCC Unified files, which you import with Import HMI Files...; a message tells you how many were left out. Changes with a merge conflict do not show the icon: resolve the conflict first, then you can import the file.

This is handy when the AI assistant changes files in a folder under Git: the changed files appear in Source Control, and you bring them into the project from there with one click.

Generating a Commit Message with AI

With changes staged, click the sparkle icon (Generate Commit Message) in the commit message box to draft a message from your changes. This uses the editor's built-in GitHub Copilot commit-message integration and requires GitHub Copilot to be set up; it is separate from the AI Chat providers. Review and edit the suggestion, then commit.

Viewing Changes (Diff)

Click any changed file in the Source Control view to open the diff editor in the center editor area. The diff editor shows the previous content and your current content side by side (or inline; toggle the layout from the editor toolbar). Within the diff editor you can stage or revert individual changed regions from the inline gutter controls.

Branches and Sync

The current branch is shown at the left of the Status Bar (the bar along the very bottom of the window).

  • Click the branch name to switch branches or create a new branch from the picker that appears
  • The sync indicator next to the branch name shows how many commits you are ahead of or behind the upstream branch; click it to pull then push (synchronize)
  • Run Git: Push, Git: Pull, Git: Fetch, Git: Merge, and other branch operations from the Command Palette (Ctrl+Shift+P), or from the ... menu at the top of the Source Control view

Git Output

When a Git command runs, its raw output is written to the Git channel in the Output view (part of the bottom Panel). Open the Panel, switch the dropdown to Git, and you can read exactly what commands ran and any errors they returned, useful when an operation does not behave as expected.

History and Annotations

Browsing commit history, file history, and per-line blame depends on which extensions you have installed. The base editor surfaces the Timeline view (in the Explorer) showing the commit history of the currently open file, and inline change indicators in the editor gutter. Richer commit-graph, blame, and pull-request views are provided by Git extensions you can add from the marketplace; describe those features per the extension you install, since they are not part of the built-in experience.

AI explanation on the blame hover

When the editor's Git blame annotation is turned on, it can add a short AI explanation of why a change was made. Open Settings, search for AI Explanation (under Git Blame), and turn it on. It is off by default. Then hover the blame annotation at the end of a line: alongside the commit author, date, and message, a short explanation produced by your selected AI model appears, summarizing the intent of that commit. To produce it, the commit message and that commit's change to the current file are sent to your model, so it works only while you are signed in to an AI provider; with the setting off, the hover is unchanged.