News for hackers. Stuff that matters.
Re:Git ignores .gitignore with .gitignore in .gitignore by rollcat on Wednesday May 18, 2022 @06:19AM (#31421016)
This is my strategy for dotfiles. My home directory has a .gitignore with "*" in it. I will "git add -f" any files I want tracked; git is extremely efficient at ignoring the rest. It doesn't require any frameworks, symlinks, installation scripts, elaborate tutorials/manpages, or any other voodoo.

To move in to a new machine - unfortunately you can't git clone into a non-empty directory, but the commands to work around that are simple enough to remember.

https://github.com/rollcat/dotfiles

Re:Git ignores .gitignore with .gitignore in .gitignore by JoshTriplett on Wednesday May 18, 2022 @06:23AM (#31421041)
I prefer to list individual directories and files in my ~/.gitignore so that I see when new files show up and I can decide whether to ignore them, commit them, or prevent them from getting generated.
Re:Git ignores .gitignore with .gitignore in .gitignore by rollcat on Wednesday May 18, 2022 @06:55AM (#31421237)
It tends to blow up "git status" if some random new piece of software (or random me) makes a random new subfolder, full of random things. You can override .gitignore for specific subfolders like .config, .emacs.d, etc.
Re:Git ignores .gitignore with .gitignore in .gitignore by burntsushi on Wednesday May 18, 2022 @10:20AM (#31423115)
That's what I used to do, but I switched to Josh's strategy a couple years ago.[1] It doesn't "blow up" git-status. If some new piece of software creates a new directory with a bunch of random stuff in it, git-status will just show you the directory since it is is untracked, and not everything in it.

[1]: https://github.com/BurntSushi/dotfiles/blob/965383e6eeb0bad4...