如何去除所有文件夹 [英] How to git-pull all but one folder

查看:131
本文介绍了如何去除所有文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何方法可以在存储库中找到 git pull 所有文件夹,但只有一个?我不想创建.gitignore文件,因为其他人可能需要该文件夹 - 这对于我来说现在太大了。



谢谢!

p>

解决方案

我不认为你可以做部分拉动,但你可以试着看看会发生什么,如果你拉着一棵工作树没有完全签出。



Git1.7 ,你可以做一个 -example-in-git-1-7rel =nofollow noreferrer>这里说明了,这意味着你的工作树在填充它的内容时会明确地排除该特定的文件夹。



现在,如果该目录很大,最好在自治的Git存储库中隔离它,允许其他用户将其称为 子模块

Is there any way to git pull all folders in the repository but one? I don't want to create a .gitignore file because other people may want the folder -- it's just too large for me to use right now.

Thanks!

解决方案

I don't think you can do partial pulling, but you can try and see what happen if you pull in a working tree which is not completely checked out.

Since Git1.7, you can do a sparse checkout, as illustrated here, meaning your working tree would explicitly exclude that specific folder when populate its content.

Now if that directory is that big, it may be better to isolate it in an autonomous Git repository, allowing other users to refer to it as a submodule.

这篇关于如何去除所有文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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