Git Implementation

Before you can use the Git functionality you have to setup your WinCC OA project and the GEDI. The following paragraphs describe the required preparations.

Git Functionality in the GEDI and Local Repository

The basic setup for Git creates a local repository for your project, where any changes are tracked during development.

To produce a local Git repository for your project you have to set the config entry [ui]versionControl to "git". The preferred compare tool is set with the [ui]versionControlDiff config entry.

[ui]
versionControl = "git"
versionControlDiff = "<path>/<diff program name>"

After setting the config entry, it is necessary to restart the GEDI to activate the Git functionality. This will load the script "git.ctl", which will check if the Git command line tool is installed and if the project is already under git control. You will be asked to confirm the Git version control for this project in a separate dialog. Upon confirmation, if it is not already present, the "git.dir" folder is added to your project. Within the GEDI, the colored file-state information is enabled, and the Git functions are added to the context menu. Additionally, the "data", "config" and "dpList" subdirectories are now shown in the project view.

Notes for config entries

  • If the [ui]versionControlDiff config is not set, WinCC OA will try to locate "kdiff3" or "bcompare" on your machine to use as compare tool.

  • The config entry [ui]versionControl is used in gedi/projectView.ctl to check if it contains "git" to activate this version control system. If other VCS shall be used, it's possible to create separate scripts for each VCS. The name must be exactly the name defined as value of the config entry. E.g.: versionControl = "XYZ" means that there must be the script "XYZ.ctl". this script must be located in the scripts/gedi folder (e.g.: scripts/gedi/git.ctl).

Connecting to a remote Git Repository

It is also possible to connect your local repository to a server.

For this the function "git remote set-url" is used inside the Git-Bash to set the url of the remote repository.

git remote set-url <url>

After setting the url the functions "git pull" and "git push" can be used from inside the GEDI to receive changes from the server or to move commits to the server.