Github: linguist-generated=true not working in .gitattributes

4k Views Asked by At

I am storing all the generated files in the build folder and trying to ignore these files in the pull request, I found and used the following method for doing so:

1.Create a .gitattributes file in the root directory.

2.Add this code to it:

build/**/* linguist-generated=true
/build/**/* linguist-generated=true
/build/**/*.html linguist-generated=true
build/*.html linguist-generated=true
build/ linguist-generated=true
/build/ linguist-generated=true
build/name.html linguist-generated=true
/build/name.html linguist-generated=true

I know all these lines might not be necessary but this is everything I have already tried to see if it works, but the files in the build folder still show up in PR changed files tab, What am I doing wrong here?

1

There are 1 best solutions below

0
Odasaku On

What I realized is that I was mistaken in thinking that the files won't show up at all, instead, these files show up in the changed files, but just that the changes in them are not loaded by default and we can click on load diff, if we want, like the way a normal file shows up if it has big changes in it.