rustic icon indicating copy to clipboard operation
rustic copied to clipboard

Feature: Configurable exceptions for gitignore

Open intgr opened this issue 1 year ago • 2 comments

I have tons of git repositories under my home directory, which I want to keep backed up.

I want to keep git-ignore = true in my settings to ignore build artifacts and most unnecessary junk in repositories.

But there are certain paths, which are gitignored (I don't want to share with other developers), but still want backed up:

  • _local - I often create such a directory in a repository root, which can contain partial experiments, personal notes, etc.
  • .idea - if I ever run into a disaster recovery scenario, it would greatly speed up recovery if per-project IDE configuration (IntelliJ IDEA) is preserved.

I might put in the effort to submit a PR for this, but first I want to ensure the feature makes sense to others.

I guess this would be an additional setting. Naming is a bit complicated, since it's a double negative, "git-ignore-ignores" probably wouldn't fly. 😄

I think this should only apply if a path would be matched by glob = [...], but is excluded by .gitignore. So glob exclude rule can still exclude _local from a backup.

Maybe git-ignore-exceptions = ["_local", ".idea", "maybe*glob*syntax*too"]

git-ignore-override?

intgr avatar Jun 19 '24 11:06 intgr