GitHub 文件夹上有一个白色箭头 [英] GitHub folders have a white arrow on them

查看:51
本文介绍了GitHub 文件夹上有一个白色箭头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近推送到 github,在我的一个文件夹上看到一个白色箭头.

I have recently pushed to github, and see a white arrow on one of my folders.

当我点击文件夹时,它没有打开它.在我的本地机器上,它有内容,但在 github 中我无法访问它们.这是什么意思?

and when i click on the folder, it does not open it. On my local machine, it has contents, but in github i cannot access them. What does this mean?

推荐答案

症状

检查本地是否在该文件夹下有 .git/ 子文件夹.

这意味着文件夹(本地)是一个嵌套的 Git 存储库,其树 SHA1 被记录为gitlink".(带白色直箭头的灰色文件夹)

That would mean the folder (locally) is a nested Git repository, whose tree SHA1 is recorded as a "gitlink" (gray folder with straight white arrow)

然后你会在 GitHub 上看到的是 gitlink:对象的 SHA-1 引用另一个存储库中的提交,由空文件夹名称表示.它是一个嵌套的 Git 存储库.

What you would then see on GitHub is that gitlink: SHA-1 of the object refers to a commit in another repository, represented by an empty folder name. It is a nested Git repository.

如果你看到一个folder@xxx,那么它就是一个子模块entry,意思是你自己的仓库里面有一个.gitmodules,里面除了gitlink之外,还记录了远程仓库的实际URL.
它表示超级项目期望嵌套子模块的工作目录所在的提交的对象名称.

If you see a folder @ xxx, then it is a submodule entry, meaning your own repository has a .gitmodules in it, which records, in addition of the gitlink, the actual URL of the remote repository.
It represents the object name of the commit that the super-project expects the nested submodule's working directory to be at.

在这两种情况下(带有文件夹名称的白色箭头,或带有folder@xxx、文件夹名称​​和版本的白色箭头),它都是一个 Gitlink,代表了一个嵌套的 Git存储库:另一个 Git 存储库的占位符,因此是一个空文件夹.但在第二种情况下,该空文件夹将在特殊的 .gitmodules 文件中引用/可见.

In both cases (white arrow with a folder name, or white arrow with folder @ xxx, folder name and version), it is a Gitlink represented a nested Git repository: a placeholder for another Git repository, hence an empty folder. But in the second case, that empty folder would be referenced/visible in a special .gitmodules file.

为了恢复该文件夹内容:

In order to restore that folder content:

git clone --recurse-submodules在本地存储库中恢复该子模块的内容(与嵌套的 Git 存储库相反,它的 URL 记录,并且文件夹的内容将保持为空)

A git clone --recurse-submodules would restore the content of that submodule in your local repository (as opposed to a nested Git repo, where its URL is not recorded, and the content of the folder would remain empty)

白色箭头将保留在远程存储库上,folder @ version 显示您的项目引用的子模块存储库的 SHA1.

The white arrow would remain on the remote repository, with folder @ version displaying what SHA1 of the submodule repository is referenced by your project.

或者,如果您不关心该文件夹的历史记录,您可以在本地删除它的 .git 子文件夹(假设它不是一个子模块,意思是它没有在您的主存储库中的 .gitmodules 文件中引用)、添加、提交和推送.
然后白色箭头将消失,您将能够在 GitHub 上访问该文件夹内容.

Alternatively, you could, if you don't care about the history of that folder, delete locally its .git subfolder (assuming it is not a submodule, meaning it is not referenced in a .gitmodules file in your main repository), add, commit and push.
The white arrow would then disappear, and you would be able to access that folder content on GitHub.

这篇关于GitHub 文件夹上有一个白色箭头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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