简体   繁体   English

限制git存储库的递归性

[英]Limit recursivity of a git repository

I have created a git repository on my home directory (/home/user/.git) to "backup" and save alle changes from my dotfiles. 我已经在主目录(/home/user/.git)上创建了一个git存储库以“备份”并保存我的dotfile中的所有更改。

To solve this I have implmeneted a gitignore where I explicit ignore all files excepting the wanted dotfiles. 为了解决这个问题,我使用了gitignore,其中我明确地忽略了除所需dotfiles之外的所有文件。

But know I can access the git repository from everywhere (home/user/folder1, home/userfolder2) - Can I limit the recursivity from a git repository, so only the directory /home/user is under vcs?! 但是知道我可以从任何地方(家庭/用户/文件夹1,家庭/用户文件夹2)访问git存储库-我可以限制git存储库的递归性,因此仅目录/ home / user位于vcs下吗?

Thanks in advance! 提前致谢!

Symlinking the dotfile is one solution. 对点文件进行符号链接是一种解决方案。
I mentioned before in " One git for multiple folders in differents places " the project vcsh : one git repo for your different configs, but: 我之前在“ vcsh 在不同地方的多个文件夹使用一个git项目中提到过 :一个用于您不同配置的git repo,但是:

vcsh allows you to maintain several Git repositories in one single directory. vcsh允许您在一个目录中维护多个Git存储库。 They all maintain their working trees without clobbering each other or interfering otherwise. 他们都维护自己的工作树而不会互相干扰或干扰。

See an example in " Managing dot-files with vcsh and myrepos ", and vcsh presentation in " GitMinutes #13: Richard Hartmann on Managing Your Homedir with vcsh " 请参阅“ 使用vcsh和myrepos管理点文件 ”中的示例,以及“ GitMinutes#13:Richard Hartmann关于使用vcsh管理Homedir的内容 ”中的vcsh演示。

That is another approach to trying to have a repo directly in one's $HOME (having to exclude any subfolder). 这是尝试直接在自己的$ HOME中拥有存储库的另一种方法(必须排除任何子文件夹)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM