• Dear Cerberus X User!

    As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.

    Important: If you accept the amended Terms and Rules, you agree to the transfer of your user data to the future forum owner!

    Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.

    Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!

    Accepting ensures:

    - Continued access to your account with a short break for the actual transfer.

    - Retention of your data under the same terms.

    Without consent:

    - You don't have further access to your forum user account.

    - Your account and personal data will be deleted after April 5, 2024.

    - Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.

    We hope to keep you in our community and see you on the forum soon!

    All the best

    Your Cerberus X Team

Update to .gitattribute file

dawlane

Well-known member
CX Code Contributor
Tutorial Author
Joined
Jun 21, 2017
Messages
1,146
OK. It's been a while since I've done a bit of work on Cerberus. And last year I was looking into the line ending issue with git as part of the updates I was working on. But I have had to deal with a few personal issues over the last 3 months and haven't yet got round to integrating some of the desktop target changes into the latest Cerberus. So to start with I have posted this version of the .gitattribute file that I was working on. The idea is for the end user to set the global git settings to the correct value for their OS, set the eol of specific files via .gitattributes and preserve files that should not be touched. Git has been known to get it wrong when auto handling files by setting the eol of non text files, thus corrupting them.

Those file types that should be kept as binary will need to be hashed/CRC checked against the original versions released before the eol issue.

Code:
# This file should be treated as a 'work in progress'.
# Merge, filters and union drivers may be need at a later date. See the git documentation on these for an explanation.
# Auto text: Let git handle line conversion for those file types not listed below or set to specific eol/type.
# You should read the documentation for git that relates dealing with global settings.
# On Windows, users should have CRLF>>LF on push LF>>CRLF on pull, so make sure that git config core.autocrlf=true.
# On Linux and OSX should be LF in both directions. You shouldn't need to do anything on these OS's, unless you have changed the default eol.
* text=auto

# Git files: setting these to lf should be ok. Make sure that you use an editor that doesn't change line endings. So NO notepad, use something like Visual Studio Code.
.gitattributes text eol=lf
.gitignore text eol=lf
.gitconfig text eol=lf

# CerberusX/MonkeyX files
# Should cxs/monkey source files have lf line endings?
*.cxs text eol=lf linguist-language=cerberus
*.cerberusdoc text eol=lf
*.monkey text eol=lf
*.monkeydocs text eol=lf

# Source files: Let git decide based on the git global settings. Using text without an eol should use the default core.autocrlf or the OS's git default settings.
# According to one source, the use of the built-in drivers such as 'csharp' should not be use as they may not updated on a regular basis and may cause compile errors.
*.c text
*.cc text
*.cxx text
*.cpp text
*.hpp text
*.h text
*.hpp text
*.hxx text
*.hh text
*.cs text
*.as text
*.htm text
*.html text
*.xhtml text
*.css text
*.json text
*.java text
*.js text
*.md text
*.xml text
*.ini text
*.hlsl text
*.rc text eol=crlf
*.bmx text
# Precompiled headers. Not sure if these should be touched, so treat them as binary files.
*.pch binary

# Visual Studio/Windows known common files convert from lf to crlf to avoid Visual studio warnings.
*.sln text eol=crlf
*.vcxproj text eol=crlf
*.vcxproj.filters text eol=crlf
*.csproj text eol=crlf
*.rex text eol=crlf
*.xaml text eol=crlf
*.appmanifest eol=crlf
*.manifest eol=crlf
# Assuming that pfx is a securty key and shouldn't be messed with.
*.pfx binary

# Xcode
# Check that these are correct and don't all need to be binary. Only pbxproj so far needs to be kept as binary as thats how Xcode handles it even though it is an xml file.
*.pbxproj binary
*.plist text eol=lf
*.xcworkspacedata text eol=lf
*.strings text eol=lf
*.m eol=lf
*.mm text eol=lf
*.xib text eol=lf

# Linux/OSX
*.sh text eol=lf
README text eol=lf
COPYING text eol=lf
CHANGES text eol=lf

# Windows
*.bat text eol=crlf
*.ps1 text eol=crlf
# Should txt cause problems with line endings on other OS's, then remove the eol=crlf and let git global 'text' deal with it.
*.txt text eol=crlf

# Android target.
/targets/android/template/*.keystore binary
/targets/android/template/gradletemplate/gradlew eol=lf

# Image/Fonts/Audio files
# List not complete. If any thing else is added to the repo then these need to be updated.
*.bmp binary
*.png binary
*.jpg binary
*.jpeg binary
*.ico binary
*.icns binary
*.cur binary
*.ttf binary
*.font binary
*.gif binary
*.wav binary
*.ogg binary
*.mp3 binary
*.m4a binary
*.tiff binary
*.caf binary
*.aiff binary

# Other binrary types such as static, shared libraries and document formats.
# List not complete. If any thing else is added to the repo then these need to be updated.
*.pdf binary
*.a binary
*.lib binary
*.so binary
*.dll binary
*.o binary
*.class binary

# Compressed archive files
# List not complete. If any thing else is added to the repo then these need to be updated.
*.gz binary
*.zip binary
*.ZIP binary
*.jar binary
 
Cool, that will help a lot I guess.
The idea is for the end user to set the global git settings to the correct value for their OS
I am just using Git Desktop without changing anything. Am I doing it wrong?
 
It depends on the OS's and git client that you are using. The client's documentation should have details on how to check and set global settings.

Edit: You should do a few local clones to check that the files types and eols are consistent.
 
Last edited:
I am just using Git Desktop without changing anything. Am I doing it wrong?
It would be a question on how you have your git client set up. Generally when installing Git for Windows on Windows it gives you three options:
  1. Checkout Windows-style, commit Unix-style line endings. Recommended for cross platform projects on Windows ("core.autocrlf=true")
  2. Checkout as-is, commit Unix-style line endings. Recommended for cross platform projects on Unix ("core.autocrlf=input")
  3. Checkout as-is, commit as-is. Not recommended for cross platform ("core.autocrlf=false").

Option one would be recommended for Windows users.
Unix OS's don't normally have core.autocrlf set and as long as you are using an editor such as Visual Studio Code that can set eol, then you don't need to worry about setting core.autocrlf on these OS's.

Edit: On Win 10 I have Git for Windows installed using option 1 and GitKraken set up to use the git bash terminal.
 
Last edited:
I am using this one, Github's own solution.
If I remember Github Desktop should install it's own command line shell that you can use to check and set global values.
You can find the command options here and here.

e.g.
$ git config --global --list
user.email=dawlane@********
user.name=dawlane
core.autocrlf=true
core.editor=code --wait
winupdater.recentlyseenversion=2.15.1.windows.2
 
Last edited:
Back
Top Bottom