我有一个 git 仓库,其目录结构如下所示:
root ---------- src
|
|
|------ 3rd
root
是我的工作目录,3rd
由多个第三方 git 子模块组成。
projectile-find-file
只能在 src
中找到文件,它对子模块不起作用。
最佳答案
projectile-git-command
使用git ls-files
列出属于项目的文件,
所以我用下面的代码解决了这个问题:
(setq projectile-git-command "git-ls-all-files")
git-ls-all-files
是一个 shell 脚本:
\#!/bin/zsh
files=`git ls-files -co --exclude-standard`
sb_files=`git --no-pager submodule --quiet foreach 'git ls-files --full-name -co --exclude-standard | sed s!^!$path/!'`
all_files=$files$sb_files
echo $all_files
关于git - 在一个项目中具有多个 repos(git/svn 等)的 Emacs 射弹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23211136/