git是否忽略空文件夹? [英] Does git ignore empty folders?

查看:551
本文介绍了git是否忽略空文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个Android项目,将它添加到了我的git仓库中,并将我的克隆推送给了主人。后来我试着检出项目,Eclipse抱怨缺少src文件夹。我检查了我的回购和主回购和src文件夹丢失(我确定他们在那里,当我创建项目)。那么有人可以解释这里发生了什么?我是新来的混帐,所以也许我错过了什么? 解决方案

Git不会忽略空目录。它会忽略所有的目录。在Git中,目录只是通过其内容隐含存在。 Emtpy目录没有内容,因此它们不存在。



或者换句话说:Git是一个内容跟踪器。空目录不是内容。


I created an Android project, added it to my git repo, comitted and pushed my clone to the master. Later I tried checking out the project and Eclipse complained about missing src folders. I checked my repo and the master repo and the src folders are missing (Im sure they were there when I created the project). So can someone explain what happened here? Im new to git so maybe I missed something?

解决方案

Git doesn't ignore empty directories. It ignores all directories. In Git, directories exist only implicitly, through their contents. Emtpy directories have no contents, therefore they don't exist.

Or to put it another way: Git is a content tracker. Empty directories are not content.

这篇关于git是否忽略空文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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