Ignoring certain files from contributors statistics

I thought I could use the .gitattributes file to ignore files from the contributor statistics:

However, I think I misunderstood, and this is actually only for language stats?

Is there a way to ignore certain files from contributor statistics? For example, committing a package lock file added about 15,000 lines to my contribution statics, although this is obviously misleading, as it is an auto-generated file.

1 Like

Hi @kiancross :wave:

This is not possible. Users have no control over what is counted towards contributions. Every line of code will be counted.

Thanks for the reply @ernest-phillips. It’s a shame that this isn’t possible, as it makes those stats fairly useless. A lockfile containing 20 thousand lines completely skews the stats and so no insight can be gained from them. Surely lots of other people have this problem - any idea how they deal with it? Is it possible to make feature requests to GitHub?

1 Like

I am not aware of any workaround for such files. Perhaps others in the community can provide insight there.

You can make a feature request by submitting this through our official product feedback form so that our product team can track your request.

This is a huge problem, github should add a dot file in the repo for such auto generated files.
For now the only way to workaround counting those lines is to leave the author to another value other than your email which is what is being used to count your contributions. These lock files are painful.

git add package-lock.json
git commit -m 'initial commit' --author='nocontribute <>'