My coworker has an issue where his commits keep including every single file in the repository instead of just the changed ones. The file contents are literally identical, but the changeset in our private Github repository shows all of the previous version’s lines removed and all of the “new” version’s lines added, even though there was actually no change at all. This is also happening with binary files and again, the actual files are identical from the first version to the next.
What would cause this and how can it be prevented?
Since Git identifies files by hashing their contents, truly identical files will never be stored twice.
What you are seeing may be a symptom of line ending differences between repositories. It’s hard to give precise advice without knowing more about your setup, but reading about Git’s config options
core.autocrlfandcore.safecrlfmay probably help you.