I realize that I can't provide a reproducible example; I need to tell a story (sorry).
I recently upgraded my Mac to Big Sur. Of course, one of the first things I did was install.packages("usethis"), then usethis::git_vaccinate().
I kept on seeing .DS_Store wanting to be committed, which was odd, so I kept adding it to local .gitignore. Finally, this morning, I said "enough" and started digging into it.
Of course, my ~/.gitignore file looked OK, so a little investigation brought me to this SO answer, and sure enough, I did not have git's core.excludesfile set.
So I set core.excludesfile, and .DS_Store "went away".
I see that in edit_git_ignore(), if there is no global gitignore file: you set core.excludesfile, then call git_vaccinate().
However, if you just call git_vaccinate(), I don't see that core.excludesfile gets set. I think this is how I got here.
As well git_vaccinated() does not check that core.excludesfile is set.
I have a few ideas on some solutions, and will be happy to contribute, but I figure I'd let you react first.
Thanks!
I realize that I can't provide a reproducible example; I need to tell a story (sorry).
I recently upgraded my Mac to Big Sur. Of course, one of the first things I did was
install.packages("usethis"), thenusethis::git_vaccinate().I kept on seeing
.DS_Storewanting to be committed, which was odd, so I kept adding it to local.gitignore. Finally, this morning, I said "enough" and started digging into it.Of course, my
~/.gitignorefile looked OK, so a little investigation brought me to this SO answer, and sure enough, I did not have git'score.excludesfileset.So I set
core.excludesfile, and.DS_Store"went away".I see that in
edit_git_ignore(), if there is no global gitignore file: you setcore.excludesfile, then callgit_vaccinate().However, if you just call
git_vaccinate(), I don't see thatcore.excludesfilegets set. I think this is how I got here.As well
git_vaccinated()does not check thatcore.excludesfileis set.I have a few ideas on some solutions, and will be happy to contribute, but I figure I'd let you react first.
Thanks!