GitHub仓库中的文件夹变灰了吗? [英] Greyed out folder in GitHub repo?

查看:162
本文介绍了GitHub仓库中的文件夹变灰了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,所以我将一个新文件夹推送到了我的GitHub存储库中,它变灰了.为什么?

Hey so I pushed a new folder to my GitHub repository and well it is greyed out. Why?

我是git的新手,并且可能已经对git做了一些事情来导致这种情况,所以我怎么能从新鲜开始呢?

I'm new to git and have probably done something to git to cause this so how can i start from fresh?

这是我的仓库的链接: https://github.com /ZoidinCode/ZoidinCode.github.io/tree/master/dist

Here's a link to my repo: https://github.com/ZoidinCode/ZoidinCode.github.io/tree/master/dist

我已经卸载了Git,然后重新安装了它,这确实发生了:(

I've uninstalled Git and then re-installed it and well this has happened :(

Git:

  cd desktop/Artificial-Reason-1.4.6
bash: cd: desktop/Artificial-Reason-1.4.6: No such file or directory

XXXX~/desktop/Artificial-Reason-1.4.6 (master)
$ git add dist/header_light_dark

XXXX ~/desktop/Artificial-Reason-1.4.6 (master)
$ git commit -m "First commit to GitHub"
[master 0e2035b] First commit to GitHub
 1 file changed, 1 insertion(+)
 create mode 160000 dist/header_light_dark

XXXX ~/desktop/Artificial-Reason-1.4.6 (master)
$ git push origin master
Counting objects: 1229, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (1223/1223), done.
Writing objects: 100% (1229/1229), 49.79 MiB | 443.00 KiB/s, done.
Total 1229 (delta 848), reused 0 (delta 0)
To https://github.com/ZoidinCode/ZoidinCode.github.io.git
 * [new branch]      master -> master

推荐答案

GitHub上的灰色文件夹看起来像

A gray folder on GitHub looks like a submodule, as I mentioned in:

  • "What is this grey git icon?"
  • "What does a grey icon in remote GitHub mean"

它不是子文件夹,而是特殊条目 .com/a/2227598/6309>索引,将其标记为类似子模块.

It is not a sub-folder, but a special entry in the index which marks it as a submodule-like.

如果主存储库中没有.gitmodules文件,则该特殊条目通常是添加嵌套存储库的典型项:检查dist/文件夹本身是否具有.git/子文件夹.

If you don't have a .gitmodules file in your main repo, that special entry is typical of adding a nested repo: check if your dist/ folder has itself a .git/ subfolder.

要解决此问题,请尝试使用git rm --cached dist(不带斜杠).
在"无法从Git存储库中删除子模块"

To fix the issue, try a git rm --cached dist (no trailing slash).
See more at "Cannot remove submodule from Git repo"

git rm --cached dist
git commit -m "Remove submodule entry"
rm -Rf dist/.git # delete the nested repo
git add dist
git commit -m "Add dist plain subfolder"
git push

这篇关于GitHub仓库中的文件夹变灰了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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