In my Clojure projects, I like to keep my REPL namespace separate from my other source files, so I always have something like this in my project.clj:

:profiles {:dev {:source-paths ["dev"]
                 :repl-options {:init-ns user}}}

Since I only use that file (and its parent directory) for temporary definitions and experimentation and such, I don't want it in version control, so I put the whole directory in my .gitignore:


So my project structure looks something like this:

├── dev
│   └── user.clj
├── .gitignore
├── project.clj
└── ...

Now, for the most part, Projectile works great for navigating around projects; I can use C-c p f to quickly switch to my source files, tests, documentation, project.clj, .gitignore, etc.

But I can't switch to my REPL namespace file! I tried adding a .projectile file to my project and playing around with that, but as far as I can tell, if a file is in .gitignore, there is no way to tell Projectile not to ignore it.

So my question is, is it possible to ignore a file or directory in Git but not in Projectile?

1 Answer 1


Since 2016-04-05, you can use a bang prefix to override ignored profiles, as explained in the docs. For instance, to override the .gitignore in the question for the files in the /dev folder, you could use a .projectile file that looks like this:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.