ZH version is available. Content is displayed in original English for accuracy.
Advertisement
Advertisement
⚡ Community Insights
Discussion Sentiment
48% Positive
Analyzed from 1647 words in the discussion.
Trending Topics
#git#gitignore#ignore#file#repo#config#docs#exclude#build#files

Discussion (50 Comments)Read Original on HackerNews
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
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.
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
I run the same presubmits on pre-receive and merge requests, so you wouldn't get too far shooting your own foot. But yeah, if you're not using the feature then it wouldn't save you so it's not foolproof. I also run tools for scanning for credentials, etc.
For example, with direnv, the `.envrc` in my projects usually has
And the repo also ships with a `.envrc.local.example` file.> Some configs don't allow extending
You can use this subcommand to learn which ignore file is causing your files to be ignored.
https://git-scm.com/docs/git-check-ignore
I've been leaving notes sitting untracked rather than put a filename only I use into the repo. .git/info/exclude is what I actually needed.
Beyond things not being neatly compartmentalized, what is the problem? The only risk I see is that you'll have a file you forgot to commit because it happened to match one of those patterns.
Having strong opinions on stuff like this is not healthy.
I’ve used pre-commit hooks for this but I’d rather a simple config flag, it seems trivial.
The more useful thing here is the "typical use" of each one. People who don't know about other methods get this wrong a lot and put cruft from their own tools/editors in .gitignore which is annoying.
.gitignore is banished in every project I'm in charge of. Everyone is required to manage their personal .git/info/exclude themselves, and any changeset attempting to slip .gitignore into the project will get ipso facto rejected. (Anyone is free to submit a change that adds a file contrib/gitignore if you think you have a set of useful globs relevant to the project that will be a help to others, along with instructions to cp that file to .git/info/exclude, but .gitignore is not making it in.)
Git needs to ship a git-ignore command (or extend git-config) that exclusively works by managing .git/info/exclude for you, including converting "legacy" .gitignore into the less anti-social version.
(You have lost the plot; your response amounts to explaining how soap and water works to someone who has just described their office mate's tendency not to shower.)
Also:
Also you can do `git status --ignored` and it will list all files changed, even if ignored. If that is really your main issue.