Git忽略子目录中的.git目录 [英] Git is ignoring .git directories in subdirectories

查看:183
本文介绍了Git忽略子目录中的.git目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的问题是,在我的$ HOME下,我的$ HOME $目录中使用了git作为备份工具和'漫游配置文件'我有一个开发目录,有多个我正在开发的git项目。 Git不允许我添加子目录.git文件夹。因此,为了承诺这些项目,我必须将这些更改推送到我的$ HOME git仓库中,然后将笔记本电脑(创建它们的位置以及.git目录存在)提交给我。

我已阅读了关于子模块的内容,但这并不是我想要的。我只想让孩子的.git文件夹像任何旧的目录一样对待,这样我就可以将它们移动并备份起来。



有没有人做过这个或有一个想法我会吗?

解决方案

我个人使用git来同步一些像.profile或.vimrc这样的点文件。为了避免类似你的问题,我的git位于$ HOME / dot中,单个文件在$ HOME中被链接。


I'm using git as a backup tool and 'roaming profile' for my $HOME directory between laptop and desktop.

My problem is that under my $HOME I have a Development directory with multiple git projects I'm working on. Git will not allow me to add the subdirectories .git folders. So to commit to these projects I have to push the changes into my $HOME git repo, pull on laptop (where they were created and .git dir exsits) and commit.

I've read about submodules, but it's not really what I want. I just want the children .git folders to be treated like any old directory so I can move them around and back them up.

Has anyone done this or have an idea how I would?

解决方案

I'm personally using git to sync some dot-files like .profile or .vimrc. To avoid problems like yours my git is located in $HOME/dot and the single files are symlinked in $HOME.

这篇关于Git忽略子目录中的.git目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆