Skip to content

Commit

Permalink
docs: fix .gitignore code snippet
Browse files Browse the repository at this point in the history
I couldn't unignore a subfolder in `Vocab` using the code snippet from the documentation:

```
.github/styles/*
!.github/styles/Vocab/Base
```

Found a solution [here](https://stackoverflow.com/a/5534865/10308406).
  • Loading branch information
f-hollow authored Jul 4, 2023
1 parent b465289 commit e76bf72
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion content/en/docs/topics/packages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,17 @@ that you'll also have some local components as well.
# `Vocab/Base` folder.

.github/styles/*
!.github/styles/Vocab/

.github/styles/Vocab/*
!.github/styles/Vocab/Base
```

The above example ignores the entire `.github/styles/` folder *except* for
`.github/styles/Vocab/Base` (which we want to track changes for).
`.github/styles/Vocab/Base` (which we want to track changes for).
The rules to ignore subfolders are written in pairs, because Git disregards
skip-level unignore rules. Any unignored item should have its parent folder
unignored as well.

[1]: /hub/write-good/
[2]: /hub/hugo/

0 comments on commit e76bf72

Please sign in to comment.