6 ms·
You can just add it in a user-level gitignore instead of ignoring it in every repo. See: ~/.config/git/ignore
by Zambyte 11d ago
You can just add it in a user-level gitignore instead of ignoring it in every repo. See: ~/.config/git/ignore
- saghm 11d agoI only realized very recently that being able to specify .gitignore files in any part of a repo can be combined with wildcards to just put `.gitignore` with `*` in a arbitrary directories to make them get ignored without needing to modify any wider configuration.
- zzril 11d agoI'm doing that all the time. Starting with a .vim directory that contains vim-specific files, such as scripts / build commands to be run on certain key combinations, to ".misc" / ".scratch" / ".notes" / ".api-keys" directories... I wouldn't want to list them all in my global .gitignore because I'd certainly forget half of the names I tend to give to these...
- der_gopher 11d agoyes, but user level is not a repo level
- sReinwald 11d agoYes, but this is exactly the sort of thing that should be a user-level configuration. A personal scratch directory has nothing to do with the repository itself and doesn’t belong in a repo’s .gitignore. If it's only needed for one particular checkout, .git/info/exclude is the other obvious option.
- leleat 11d agoYou don't need to put the scratch directory in the committed gitignore file. gitignore files are recursive. So a common approach is to use a gitignore with * in the scratch directory.
- zelphirkalt 11d agoThis has the disadvantage though, that this user level gitignore file will not be in the repo, which means that other less careful contributors have to fix ignoribg for themselves.
- mckee_plus_plus 11d agoAnd then you have a known path to script up all your repos' stuff for backup