.gitignore for TwinCAT 3 and TwinCAT HMI

When using git on your projects you often come across files which does not need to be versioned. These may be for example output files of compilation or settings of development environment. In other words you do not want to version files which are not source code. For these purposes the .gitignore file is used. This file tells git which files or folders you would like to omit.

Add these lines to your project .gitignore. There are paths for TwinCAT as well as TwinCAT HMI. It is based on this listing: https://github.com/github/gitignore/blob/main/TwinCAT3.gitignore

Additionaly (as mentioned in the link) I suggest to use VisualStudio.gitignore as a base and just add these lines to the file. If you create git repository using TwinCAT tools the VisualStudio’s gitignore is created automatically.

Don’t forget to update git cache so the files are actually ignored. Here is some tutorial I found on the interwebs: https://sigalambigha.home.blog/2020/03/11/how-to-refresh-gitignore/

# TwinCAT
*.tpy
*.tclrs
#*.compiled-library
*.compileinfo
*.tmcRefac
#*.library
*.project.~u
*.tsproj.bak
*.xti.bak
LineIDs.dbg.bak
LineIDs.dbg
_Boot/
_CompileInfo/
_Libraries/
_ModuleInstall/
.vs/

# TwinCAT HMI
.engineering_servers/
liveview_*
*.cache
*.db-shm
*.db-wal
*.pid
.hmiframework/
.hmipkgs/*-*-*-*/
tchmipublish.journal.json

*list may be changed over time

Add .gitignore to the TwinCAT project for easy access

  1. Right click your solution in TwinCAT -> Add -> Existing Item
  2. Navigate to your project folder and select .gitignore file. Then click Add
  3. Now you can see the file in your project tree and open it

Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Optionally add an image (JPEG only)