Remove a indexed file from “Languages” on first page #5175
-
Hi! The question below: How can I remove this indexed HTML page, that are a documentation to one of the external librarys I use on my GitHub blob? I have tried alot of diffrent commands, but don't find a way to remove this file from the GitHub Linguist indexer... Here are the "Languages" that are indexed on the startpage: And the file that I want to exclude:
Code that I've tried to get it removed via
and tried:
and this:
and this:
and this:
and this:
But I can't figure it out how to remove this file:
Please help me with the correct syntax to remove this file from being indexed as a Language in my GitHub repository, main branch. 🙂 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
Current .attributes file (that still shows the HTML file in the "docs"-folder: And the file that I need removed: |
Beta Was this translation helpful? Give feedback.
-
I'll answer in both places with the same response: You've got the right idea and the right Linguist overrides (either will do the trick). The problem is your path matching isn't quite right. From the
If we look in the
The files you're trying to ignore are in sub-directories of the paths you've specified so you need to either:
We can demonstrate this without even using Linguist thanks to $ # Create a repo with just the one file
$ git init -q Test-Project
$ cd Test-Project
$ mkdir -p TestProject/wwwroot/lib/bootstrap-icons/docs/
$ echo "<html>" > TestProject/wwwroot/lib/bootstrap-icons/docs/index.html
$ git add -A
$ git commit -m 'Add file'
[main (root-commit) bed71b5] Add file
1 file changed, 1 insertion(+)
create mode 100644 TestProject/wwwroot/lib/bootstrap-icons/docs/index.html
$
$ # Add your initial override
$ git add -A && git commit -m 'attribs'
[main 7d0a0cf] attribs
1 file changed, 1 insertion(+)
create mode 100644 .gitattributes
$
$ # Check the attributes
$ git check-attr linguist-vendored TestProject/wwwroot/lib/bootstrap-icons/docs/index.html
TestProject/wwwroot/lib/bootstrap-icons/docs/index.html: linguist-vendored: unspecified
$ # So it doesn't have any effect.
$ # Now lets recurse
$ echo "TestProject/wwwroot/lib/** linguist-vendored" > .gitattributes
$ git add -A && git commit -m 'attribs'
[main 9007c34] attribs
1 file changed, 1 insertion(+), 1 deletion(-)
$ git check-attr linguist-vendored TestProject/wwwroot/lib/bootstrap-icons/docs/index.html
TestProject/wwwroot/lib/bootstrap-icons/docs/index.html: linguist-vendored: set
$ # Woohoo!!! It's work.
$ # Lets be specific to the docs dir
$ echo "TestProject/wwwroot/lib/bootstrap-icons/docs/* linguist-vendored" > .gitattributes
$ git add -A && git commit -m 'attribs'
[main a46f416] attribs
1 file changed, 1 insertion(+), 1 deletion(-)
$ git check-attr linguist-vendored TestProject/wwwroot/lib/bootstrap-icons/docs/index.html
TestProject/wwwroot/lib/bootstrap-icons/docs/index.html: linguist-vendored: set
$ # Woohoo!!! It's worked too |
Beta Was this translation helpful? Give feedback.
-
One ugly workaround to get the file to be not shown, seems to be: Move the file from: and maybe rename it: |
Beta Was this translation helpful? Give feedback.
I'll answer in both places with the same response:
You've got the right idea and the right Linguist overrides (either will do the trick). The problem is your path matching isn't quite right.
From the
.gitattributes
docsIf we look in the
.gitignore
docs (emphasis is mine):