Don't accept people playing with shotgun commits; there, problem(s) solved.
.gitignore Is Inherently Sisyphean
11–20 of 68 posts
Re: .gitignore Is Inherently Sisyphean
#12(git config --global core.excludesfile "$CONFIG/git/ignore")
.gitignore is committed to the repository and should be for files created by the repository that shouldn't appear in 'git status' like build/, etc.
Re: .gitignore Is Inherently Sisyphean
#13Also, 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 file
if a parent directory of that file is excluded. Git
doesn’t list excluded directories for performance
reasons, so any patterns on contained files have no
effect, no matter where they are defined. [...]Re: .gitignore Is Inherently Sisyphean
#14While I don't think we've ever merged a pr with ide files, we do merge the .gitignore part when people put them in their commits which has lead to growth over time...
Re: .gitignore Is Inherently Sisyphean
#15Re: .gitignore Is Inherently Sisyphean
#16I 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.
Ultimately, it's the responsibility of each developer to determine whether or not the files they've added to their local clone really belong in source control! I've never encountered this issue, either, and I think I'd be unhappy working on a team where it was a serious problem.
That said, the whitelist approach does seem kinda interesting. It's really what should be present from the start, since Git had a manual staging process. But maybe this gap highlights a legit usabiiity issue. Maybe "add everything" plus an explicit, version-controlled whitelist is somehow easier or more intuitive than the "add nothing" default.
--
Re: .gitignore Is Inherently Sisyphean
#17 .*/
to the gitignore. Most crap I don't want is a hidden directory. It's easy to whitelist a few bad actors, and the gitignore stays pretty short.Re: .gitignore Is Inherently Sisyphean
#18Re: .gitignore Is Inherently Sisyphean
#19This isn't a terrible way to go about things. I normally add .*/ to the gitignore. Most crap I don't want is a hidden directory. It's easy to whitelist a few bad actors, and the gitignore stays pretty short.
They decided to waste the default warning with a wrist-slap for using "master"
Re: .gitignore Is Inherently Sisyphean
#20Cool post. I highly suggest using templates from https://github.com/github/gitignore for your project as they tend to include a lot of files commonly found in them - eg .idea folders and so on.
Yes-anding this to say: For per-user gitignore, one can set the following config in ~/.gitconfig: # System-wide gitignore file # To avoid in-repo repetition for system-specifc garbage files [core] excludesfile = ~/.config/git/gitignore Then your file at ~/.config/git/gitignore can be a normal format, and not need to be stored in repo. Perfect for system files (.DS_Store...) or editor swap files etc.