After stepping back through the commit history, there were some massive commits where I changed a number of huge JSON data files, so it doesn’t appear to be an error on GitHub’s part (aside from ascribing all of those changes to a single day on the Contributors page). Knowing that there were in fact a huge number of line changes, I set out trying to work out how to ignore those files, and ran across this issue, which led me to this section of GitHub’s Linguist project’s README. After a bit of fooling around I figured out that by marking the files as generated in the .gitattributes
file they would be excluded from diffs, and thus presumably their lines would be excluded from the total contributions. As of right now my total contributions have not been corrected, but the Linguist page noted that the updates are run on a lower-priority queue, so it may take some time.
To ignore a file, add one of these attributes to it in your .gitattributes
file. The .gitattributes
file uses the same pattern syntax as .gitignore
files. If you need to do so retroactively, you’ll need to add/modify the .gitattributes
file, create a commit, then rebase to insert it into the past.
*.txt linguist-generated
# `linguist-generated` marks a file as generated, so it won't count toward
# language statistics or commit additions/deletions.
README.txt -linguist-generated
# prepending an attribute with a `-` removes it from the file
/libs/somelibrary.js linguist-vendored
# `linguist-vendored` marks a file as an external file such as a library. This
# file will still appear in commit diffs, but it won't contribute to the
# repository's language statistics
/docs/** linguist-documentation
# `linguist-documentation` marks a file as documentation. This has the same
# effect as `linguist-vendored`.
/configs/*.json linguist-detectable
/tools/merge_configs.py -linguist-detectable
# `linguist-detectable` marks a file to be counted in language statistics.
# By default it is enabled for programming languages, so you can use it to
# either include non-code files, or exclude code files.