简体   繁体   English

此文件已隐藏 - github 错误

[英]This file is hidden - github error

https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/attachment/7230109/3056274/ https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/attachment/7230109/3056274/

I am having the same problem as this guy, I was wondering how to track hidden files and their contents so that they can be committed.我和这个人有同样的问题,我想知道如何跟踪隐藏文件及其内容,以便他们可以提交。 Github seems to be globally blocking and ignoring my files (no matter which repo) when I try and drag and drop my files into it.当我尝试将我的文件拖放到 Github 时,它似乎全局阻止并忽略我的文件(无论哪个 repo)。

The problem started after I committed folders named lab1, lab2, lab3 through command line.在我通过命令行提交名为 lab1、lab2、lab3 的文件夹后,问题就开始了。 I then later decided to remove them used然后我后来决定删除它们使用

git rm -r lab1/ lab2/ lab3/

Now when I try to add all of the folders back to git, they are "detectless" and do not show up on git status , when I git add them from my local folder even with changes to my gitignore file.现在,当我尝试将所有文​​件夹添加回 git 时,它们是“检测不到的”并且不会出现在git status ,当我从本地文件夹git add它们时,即使我的gitignore文件发生了更改。

First, you can check if this is a .gitignore issue by typing, from the root folder of your repo:首先,您可以通过在存储库的根文件夹中键入以下内容来检查这是否是 .gitignore 问题:

git check-ignore -v -- lab1/a_File_In_Lab1

Second, Make sure Lab1 does not have a .git subfolder in it: that would make it a nested repository, and you would need a git rm --cached Lab1 (no trailing slash) to remove the gitlink recorded in your main repo.其次,确保 Lab1 中没有 .git 子文件夹:这将使其成为嵌套存储库,并且您需要一个git rm --cached Lab1 (没有尾部斜杠)来删除主存储库中记录的 gitlink。

As a quick workaround, you may want to use 'Create new file' option on GitHub.作为快速解决方法,您可能需要使用 GitHub 上的“创建新文件”选项。 I am having the same issue, but as the number of "hidden" files is manageable, I am simply "creating" the files on GitHub and Copy-Pasting the content inside of them.我遇到了同样的问题,但由于“隐藏”文件的数量是可以管理的,我只是在 GitHub 上“创建”文件并复制粘贴其中的内容。

This is obviously not a reliable solution we might prefer, but for now, it works!这显然不是我们可能更喜欢的可靠解决方案,但就目前而言,它有效!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM