I am trying to understand how to use https://projectile.readthedocs.io/en/latest/projects/#customizing-project-root-files but it is not clear yet.

My goal is to have nested git projects. Let's say I have a directory structure like /a/{b,c}. Folders a, b and c have been created using git clone and all contain a .git folder. From project a, I'd like to be able to use projectile-find-file over files of a, b and c.

Is it possible? Am I looking at the good documentation? Is it possible to enable this behavior only from one directory by using .dir-locals.el?

  • Did you figure it out? I m facing the same problem and was messing with projectile-project-root, trying to set it to .projectile (file that i would manually add to project roots) but somehow it still detects all the git projects. Commented Oct 25, 2019 at 8:59
  • unfortunately I didn't figure it out. Commented Oct 26, 2019 at 14:42
  • FWIW it looks to me as if adding .git to projectile-project-root-files-top-down-recurring and removing it from projectile-project-root-files-bottom-up will have the effect of making projectile keep checking the parent directory of any git root until it no longer finds a .git file. This would mean that any directories between the real root and the submodule in question would also need to be submodules. (But the documentation for these options is quite difficult to follow -- I can't tell how "top" and "bottom" are being defined, specifically.)
    – phils
    Commented Aug 25, 2020 at 10:06
  • If there are no other .dir-locals.el files below the actual project root, then one with ((nil . ((projectile-project-root . "/path/to/project")))) would also do the trick for file-visiting buffers at least.
    – phils
    Commented Aug 25, 2020 at 10:12

1 Answer 1


Same issues. Unfortunately, projectile switch project doesnt work for nested projectile projects. Or I cant get it to work,

One solution is to use helm-projectile-ag for example but prefix it eg C-u M-x helm-projectile-ag

you are prompted for options so add "-u" (the ag flag to ignore .gitignore) and it will recursively search outside of the laws laid down in .gitignore. Unfortunately, it includes cache etc.

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.