Posted by faithraven 1 day ago
Also `~/.gitignore` works as a global gitignore. I usually stick something like `katie*` in there so I can copy some `script.sh` to `katie_script.sh` and then I can make changes that I don't want to commit.
Quick edit: I'm not sure `~/.gitignore` works out of the box.. looks like I stuck that in my `~/.gitconfig` for excludesfile
.git/exclude
--assume-unchanged
--no-update-index
.And fwiw, I think global/home-dir .gitignore is bad, for everything except of OS-level spam like .DS-Store
I have dependency_tree globally excluded because it is my unique naming convention. Actually it might just be my unique approach because other people don't seem to mind having 1000 overrides for libraries they don't use.
My preference of not having much in my global gitignore is only sensible for my particular daily work, if you need to partially track build folders in projects and can't control the ignore files automatically, a global ignore might make sense.
Now that you mention it, I should add a link to those docs in the article. Thanks!
"Do the reading b/c you would be amazed how many people don't do the reading"
Reading documentation is a superpower
For example, with direnv, the `.envrc` in my projects usually has
source_env_if_exists .envrc.local
And the repo also ships with a `.envrc.local.example` file.> Some configs don't allow extending
Pick a directory for them and ignore the directory. Other team members who want to keep their own notes can use that directory as well.
I couldn't agree more with this - except that, in practice, nobody bothers to add their own environment clutter to their own global (or even project-related) gitignore. So invariably we end up with PRs (and even main :scream:) peppered with various .vscode and similar lost souls.
The other useful advice is when there is a full folder you want to ignore. Putting a .gitignore with a single "*" ignores the full folder...including the gitignore file itself.
I do use it when I quickly need to ignore the .idea folder
You can use this subcommand to learn which ignore file is causing your files to be ignored.