Yes, the time I used to hook up "rm `find ./ | grep DS_Store`" before anyone do a `git add`
find . -name '.DS_Store' -delete31–40 of 68 posts
Yes, the time I used to hook up "rm `find ./ | grep DS_Store`" before anyone do a `git add`
find . -name '.DS_Store' -deleteI have never once experienced this problem. Mostly because I don't work with people who blindly commit everything without even looking once to see what's in their commit.
Ideally people who have .DS_Store, .vscode, etc. would put them into their own $GIT_DIR/info/exclude files and not pollute the shared .gitignore with stuff from their personal setup.
This is a bad idea and if this seems necessary you are interacting with very low quality committers. People who don't even bother reading their own commits do not deserve to get their commits merged. Also, that gitignore doesn't even work. man gitignore: • An optional prefix "!" which negates the pattern; any matching file excluded by a previous pattern will become included again. It is not possible to re-include a f…
It's not terribly far off. This works:
diff --git a/.gitignore b/.gitignore.new
index 7dc7aea..fc9ebfe 100644
--- a/.gitignore
+++ b/.gitignore.new
@@ -3,17 +3,21 @@
!.gitignore
# whitelist `src` directories and their children, regardless of place
+!src
!src/**/
!src/**/*.rs
!Cargo.{toml,lock}
# whitelist root `pysrc` directory
+!/pysrc
!/pysrc/*.py
!pyproject.toml
!poetry.lock
+!/cmd
!/cmd/*.go
!main.go
!go.{mod,sum}
+!/docs
!/docs/*.md
This is how I've been managing my dotfiles for over a decade (https://github.com/cstrahan/dotfiles/blob/master/.gitignore).This is the email thread I started back on 2016/03/3 to pin down the gitignore behavior that we now have today (there was a regression between git version 2.6.0 and 2.7.0):
https://lore.kernel.org/git/1457057516.1962831.539160698.3C8...
(For posterity: the subject line was "Change in .gitignore handling: intended or bug?")
Ideally people who have .DS_Store, .vscode, etc. would put them into their own $GIT_DIR/info/exclude files and not pollute the shared .gitignore with stuff from their personal setup.
[deleted]