gpt4 book ai didi

git - 在一个项目中具有多个 repos(git/svn 等)的 Emacs 射弹

转载 作者:太空狗 更新时间:2023-10-29 12:51:39 26 4
gpt4 key购买 nike

我有一个 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com