限制 git 存储库的递归性

Limit recursivity of a git repository

我已经在我的主目录 (/home/user/.git) 上创建了一个 git 存储库到 "backup" 并保存了我的点文件中的所有更改。

为了解决这个问题,我实施了一个git忽略,我明确忽略了除了想要的点文件之外的所有文件。

但知道我可以从任何地方访问 git 存储库(home/user/folder1、home/userfolder2)- 我可以限制 git 存储库的递归性吗?目录 /home/user 在 vcs 下?!

提前致谢!

对点文件进行符号链接是一种解决方案。
我之前在“One git for multiple folders in differents places" the project vcsh:一个 git 用于不同配置的回购中提到过,但是:

vcsh allows you to maintain several Git repositories in one single directory. They all maintain their working trees without clobbering each other or interfering otherwise.

查看“Managing dot-files with vcsh and myrepos", and vcsh presentation in "GitMinutes #13: Richard Hartmann on Managing Your Homedir with vcsh”中的示例

这是另一种尝试直接在自己的 $HOME 中创建回购的方法(必须排除任何子文件夹)。