Almost two years after I created a pull request to include a default TwinCAT 3 .gitignore file into the official GitHub Gitignore repository, it has finally been accepted & merged into main branch. Download the file here.
You better not be in a hurry to propose changes! 😅
Did you know that a .gitignore file exists from Beckhoff? It appears in the project if you use the Multiuser feature which uses Git.
According to this file you should add .TcGit to your list.
Multiuser is only available since 4024, and I guess it only shows up if you use multiuser. The official Beckhoff documentation for version control does not mention anything about the .TcGit file. Fact is, I don’t find any information of what this file is on the Beckhoff website whatsoever. It seems to mention that it’s a folder, but not anything more than that. I’d suggest you contact Beckhoff support to straighten this out and create a PR.
May I suggest you something about ignoring some type of files in TC3 repos?
Since version 4024.11 it’s possible to analyze “core dump” files in case of an exception, but only with the “CompileInfo” files. I think it’s better to keep track of them, especially in the case of a release version. (ref. here)
Keeping tracks of libraries it’s not a job for the repo, but in many cases the ability to “Install libraries from project” it’s a lifesaver, especially when you open again old projects.
Hi! Yes, I’ve written about the core dump functionality previously. It seems it’s actually available even earlier than 4024.11 (even though documentation says so, it seems to have been available already in 4024.5). As written in the blog post, the “compileinfo” is created from the source files, so as long as you properly keep track of your software (which is the whole reason we have Git from the beginning) you can always re-create those files from source in order to use your coredumps.
I agree with the “Install libraries from project”, but again, as long as you keep track of the original sources you should always be able to re-build. A comment in the .gitignore might be something?
WOW really nice, congratulation. It’s good to see the twincat community evolving. I just have one question, this doesn’t include the files for TF2000 projects, right?
Hi! Thanks for feedback. No, when you create a TE2000 project Beckhoff automatically includes a .gitignore file.
I’m using a standalone project and I think that *.tspproj.bak can also be part of the list of ignores since *.tsproj.bak is use for normal projects and they essentially do the same thing.
I’m working with TwinCAT3 and using TC3 HMI. As a beginner it was a big speed bump to figure out what files to add to the gitignore and I got some excellent help from Beckhoff themselves. Perhaps you already know, but for others coming here looking for .gitignore help, these are the parts that my gitignore-file has aside from the visual studio stuff. I’ll be super honest and say I don’t understand all of it, but it works for my project so far.
### TwinCAT ###
# TwinCAT Stack Base
# TwinCAT 3.1
## TC3 HMI-related files
### TwinCAT.OpenFrameworks Stack ###
# ignore generated binaries
# but not the data folder
# IDE files which should
# be ignored
# XCode 4
# Visual Studio
# operating system
# Image file caches
# Folder config file
Thanks Louise, I’m sure others will find this useful!
[…] https://alltwincat.com/2021/05/16/official-gitignore-for-twincat-3-on-github/ […]