git 会忽略空文件夹吗? [英] Does git ignore empty folders?

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

问题描述

我创建了一个 Android 项目,将它添加到我的 git 存储库中,提交并将我的克隆推送到主服务器.后来我尝试检查项目,Eclipse 抱怨缺少 src 文件夹.我检查了我的 repo 和 master repo 以及 src 文件夹丢失(我确定它们在我创建项目时就在那里).那么有人可以解释这里发生了什么吗?我是 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 不会忽略空目录.它忽略所有目录.在 Git 中,目录仅通过其内容隐式存在.空目录没有内容,因此它们不存在.

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

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

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

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

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