Exclude files from being counted under code frequency #21858
-
Hi all, I am working on a project in MATLAB to do some basic data processing and instrument communication, for which I have made a GitHub repository (https://github.com/engelsen/Instrument-control). Recently, I committed a couple of data files (tab delimited .txt files) for a test case. These are now being counted as code under code frequency, despite my attempt to tell linguist that I would like it to ignore these files. Can anyone see what is going wrong here? I made a .gitattributes file that only contains the following:
Thanks for any help. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 3 replies
-
It looks like your project is being reported as 100% MatLab at this point. The job that calculates code frequency doesn’t run immediately so it can take a little while for things to update once you’ve uploaded a .gitattributes file. Things look good now though 👍 |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for the reply. I can see that it says 100% MATLAB, so it seems that part is indeed working well. However, under Insights->Pulse, it claims that I have so far made 21390 additions, which is apparently counting the data files I uploaded. Is there any way to fix this? |
Beta Was this translation helpful? Give feedback.
-
No, there isn’t. If you want to exclude data files from all of the stats reported about your repository then you should probably store the data files somewhere outside of the repository. |
Beta Was this translation helpful? Give feedback.
-
The problem described by @engelsen is not related to git repo, but to the statistics counting tool. The tool is not flexible enough to support required scenario. On my projects I also have “data” files or “generated code” which I must commit to the repo. package-lock.json can take 40 000 lines and must be commited for repo to work properly. Test data can take kilo-megabytes and also msut be commited for tests to work for everyone who clones the repo, including CI machines. I wasn’t able to find “dislike” or “lower votes” for this message and think it is inappropriate solution. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Try this https://proandroiddev.com/removing-noise-from-your-github-language-stats-e96113f8183d |
Beta Was this translation helpful? Give feedback.
No, there isn’t. If you want to exclude data files from all of the stats reported about your repository then you should probably store the data files somewhere outside of the repository.