Skip to main content

Managing CODESYS 4 Projects in a Version Control System

A key feature of CODESYS 4 is the text-based, UTF-8 encoded data storage: each object is stored in its own readable file. This allows projects and workspaces to be managed directly with a version control system such as Git, SVN, or Mercurial – with traceable comparison views (diffs), code reviews, and integration with CI/CD pipelines.

Deciding on whether or not a file should be under version control depends on if it is part of the source code of the project. Temporary data, binary files such as build artifacts, and user-specific settings are not included and by default should not be managed with a version control system.

The following files are managed in a version control system:

Table 1. Excludes and includes

Path/Pattern

Type

Applies to

Semantics

Description

.compileContexts

Folder

CODESYS 4

Exclude

Location for compile and reference contexts (SideCar)

Located in the <name>.iecapp^/ folder

.library-cache

Folder

CODESYS 4

Exclude

Location for resolved, compiled libraries

Located at the top level of the project (.fbsdev) and .fbslib)

Can be committed if necessary, as long as the binaries are unproblematic in the version control system; however, the folder is ignored by default.

.intermediate

Folder

CODESYS 4

Exclude

Location for temporary files, for example GDM.lock.json, which are generated for diagnostic purposes and are each located in the folder <name>.iecapp^/ to be filed

.bootapp

Folder

CODESYS 4

Exclude

Location of the generated offline boot application

If no path is specified, then in each case in the <name>.iecapp^/ folder

<name>.fbsws.user

Folder

CODESYS 4

Exclude

Location for user-specific workspace settings and user preferences

Located parallel to the workspace file

Can be committed by the user, but by default not version-controlled

.user

Folder

CODESYS 4

Exclude

Location for user-specific project settings and user preferences

Located at the top level of the project

Can be committed if necessary, but by default not version-controlled

!**/.gitignore

File

Git

Include

Defines which files are managed by Git

!**/.gitattributes

File

Git

Include

General Git rules such as line breaks



Tip

Unlike the libraries, the .devDesc cache is set to version control by default because it consists of text files.

Example 12. Example of a .gitignore file
# .gitignore file for CODESYS 4 projects
.compileContexts/
/.library-cache/
.intermediate/
.bootapp/
*.fbsws.user/
/.user/
!.gitignore
!.gitattributes