Continuing the discussion from For file synchronization between Windows and Linux, even if the files have exactly the same content, the file contents will also be sent.:
If you are using git as distributed version control system across multiple devices and operating systems, such as Windows and Linux, but you also want to keep your files in sync with Syncthing, I recommend manually configuring your git repo and making use of the official Git documentation: Git - gitattributes Documentation .
For instance, you could add a .gitattributes file to your repo with the following content: * text=auto eol=lf. This will force all your contributors to the repo to use LF line breaks, as mandated by Linux operating systems. Alternatively, you could use * text=auto eol=crlf to force Windows line breaks. Afterwards, if you have old files that you want to convert to your newest line-break rules, you can use the following commands:
git add --renormalize .
git status # Show files that will be normalized
git commit -m "Introduce end-of-line normalization"
Furthermore, maybe it would be wise to use a workflow with autocrlf = true instead. It’s usage is very well explained here: https://stackoverflow.com/questions/1967370/git-replacing-lf-with-crlf, but that alone is not enough to prevent Syncthing to sync differing line-breaks. Though, it has the advantage of avoiding complications that may emerge when using a file with non-default line-breaks on an Operating System that wasn’t designed for it. In other words: Introducing a .gitattributes file with * text=auto eol=lf my cause issues, if you try to execute a script from your git repo, when it is run on a Windows Operating systems, as it now contains the “wrong” line breaks. I personally have not run into issues though, so this is more a hypotheses of mine, so if you can confirm or deny, please leave a message here.