[英]Eclipse Git: Can't add folder to index
I'm using Eclipse for a Game Project using LibGdx as framework and Grandle (god I hate it). 我使用Eclipse作为游戏项目使用LibGdx作为框架和Grandle(上帝,我讨厌它)。
I'm trying to push the repositories to GitHub, but I can't stage the "core" folder in the commit. 我正在尝试将存储库推送到GitHub,但我无法在提交中暂存“核心”文件夹。 It's considered unstaged.
它被认为是未分期的。
When I try RightClick -> "Add to Index" it does and says nothing... 当我尝试RightClick - >“添加到索引”时,它确实没有说什么......
As it maybe usefull to know, the g2 project someway "contains" HarakaGameTwo-core & HarakaGameTwo-Desktop projects through Gradle... 可能有用的知道,g2项目通过Gradle“包含”HarakaGameTwo-core和HarakaGameTwo-Desktop项目......
Any idea how can I stage this folder ? 不知道怎么能暂存这个文件夹?
It looks like Eclipse isn't letting you add the core
folder. 看起来Eclipse不允许你添加
core
文件夹。 First, it is a good thing that you didn't add that folder, because as you can see it contains folders called bin
and build
, both of which likely contain binary files. 首先,你没有添加该文件夹是一件好事,因为你可以看到它包含名为
bin
和build
文件夹,两者都可能包含二进制文件。 In general, you should not add binary files to Git because it doesn't handle these files well. 通常,您不应该将二进制文件添加到Git,因为它不能很好地处理这些文件。
Now as to why you could not add core
, the likely explanation is that not everything contained in this folder is managed by Git. 现在,为什么你不能添加
core
,可能的解释是,这个文件夹中包含的所有内容都不是由Git管理的。 Instead, you should only be staging files which are managed by Git (the src
folder?). 相反,您应该只暂存由Git管理的文件(
src
文件夹?)。
Check if core
itself does not include a .git
folder, which would make it a nested repo, essentially ignored by EGit (and recorded by Git as a gitlink ) 检查
core
本身是否包含.git
文件夹,这会使它成为嵌套的repo,基本上被EGit忽略( 并由Git记录为gitlink )
Egit latest releases ( 4.4 or 4.5 ) should detect nested Git repo (right click on core
, Team->Share Project
) Egit最新版本( 4.4或4.5 )应检测嵌套的Git仓库(右键单击
core
, Team->Share Project
)
If this is not it, fallback to the CLI and check git status
and git ls-files
. 如果不是这样,请回退到CLI并检查
git status
和git ls-files
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.