Skip to content

~/.gitignore is ignored #1461

Description

@ijlyttle

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions