There is already a useful B&R Community post providing .gitignore and .gitattributes files for Automation Studio 4: .gitignore file for AS projects
I created this additional post because we have significantly extended the files based on information from various sources, including internal B&R samples. The result is a more comprehensive set of files that can be used for both AS 4 and AS 6 and includes several additional useful details.
We are already using these files productively in real Automation Studio projects, so they have been tested in practice.
Safety
We intentionally do not exclude any Safety-related files. There are recurring issues with Safety and version control systems which also depend on the safety version (SafetyRelease, mappSafety, Safety+). Therefore, we consider it is the safest to always check in all Safety-related files.
Feedback and additional experience are very welcome!
.gitignore
# Automation Studio 4 & 6 Template .gitignore
# Store this file in the same folder as the .apj file.
# If not, adapt leading "/" paths to your repository structure.
# Ignore AR versions (not part of project source)
/AS/System/
# Ignore build outputs
/Binaries/
# Ignore debugging configurations (watch, traces, ...)
/Diagnosis/**
# Optional: Keep watch and task trace files – uncomment to include them in Git
#!/Diagnosis/**/
#!/Diagnosis/**/*.PVM
#!/Diagnosis/**/*.tc
# Ignore standard temp folder
/Temp/
# Ignore upgrades as those are not considered part of the project source code
/Upgrades/
# Ignore user settings file
/*.set
# Keep safety-related .set files from Physical
!/Physical/**/*.set
# Ignore is-open indication
/*.isopen
# Ignore archive artifacts
*.zip
*.tar
*.7z
# Safety
# Nothing related to safety will be ignored. Always check everything in, if changes were made.
# If something is to be ignored, it is important to know exactly what it is and which safety version is being used (Safety Release, mappSafety, Safety...)
# Ignore debug logs (any depth)
**/debug.log
# Ignore Conversion logs (AS2 to AS3)
/ConvertLog.txt
# Ignore temp files
*~
~*
*.[Bb]ak
*.[Oo]rig
*.$$$
*.[Tt][Ee][Mm][Pp]
*.[Tt][Mm][Pp]
*.[Ss]wp
# Ignore IDE/editor metadata
.vscode/
.idea/
.theia/
# Ignore Windows/macOS system files
[Tt]humbs.db
[Dd]esktop.ini
*.DS_Store
$RECYCLE.BIN/
# Ignore more stuff to your liking
# ...
.gitattributes
# Disable automatic line ending conversions for all files.
# This ensures AS project files (both text and binary) are never modified by Git.
# AS projects are Windows-only and must maintain CRLF consistently.
# Prevents accidental corruption of binary files (DTM, safety, firmware, ...) from autocrlf transformations.
* -text