找到你要的答案

Q:Why can I not open my folder in GitHub?

Q:为什么我不能在GitHub上打开我的文件夹吗?

The "src" folder in one of my repository is grayed out (and is not clickable):

I took the following steps before pushing to the GitHub:

  1. I created a new repository on GitHub.
  2. I initialize dthe git on my project.
  3. git add .
  4. git commit -m "comment"
  5. git remote add origin url
  6. git push -u origin master
  7. username
  8. password

The "src" folder is showing up on GitHub but cannot be opened. What can I do?

在我的一个仓库“src”文件夹是灰色的(不可点击):

我采取了以下步骤前推到GitHub:

  1. I created a new repository on GitHub.
  2. I initialize dthe git on my project.
  3. git add .
  4. git commit -m "comment"
  5. git remote add origin url
  6. git push -u origin master
  7. username
  8. password

“src”文件夹显示在GitHub上但无法打开。我能做什么?

answer1: 回答1:

I solved problem by deleting another .git files inside folders (Hidden files and folders). You should have only one .git in root folder.

我把另一个需要解决的问题。Git文件内的文件夹(隐藏文件和文件夹)。你应该只有一个Git在根文件夹。

answer2: 回答2:

The icon mean that you have marked this folder as submodule. open your .gitmodules and you will see there the folder named as src bin.

Remove them from your submodule and it will become a regular folder

What is this grey git icon?

The icon mean that you have marked this folder as submodule. open your .gitmodules and you will see there the folder named as src bin.

删除它们从你的子模块,它将成为一个普通的文件夹

这灰色的Git的图标是什么?

answer3: 回答3:

If you clone the project you will find, that these folders are in fact empty:

​$ ls -la bin
total 0
drwxr-xr-x+ 2 fabiopoloni  staff   68  8 Okt 12:18 .
drwxr-xr-x+ 8 fabiopoloni  staff  272  8 Okt 12:18 ..

​$ ls -la src
total 0
drwxr-xr-x+ 2 fabiopoloni  staff   68  8 Okt 12:18 .
drwxr-xr-x+ 8 fabiopoloni  staff  272  8 Okt 12:18 ..

There is also no .gitmodules so it'll show you an error when viewing the status / syncing it:

​$ git submodule status
No submodule mapping found in .gitmodules for path 'bin'

​$ git submodule sync
No submodule mapping found in .gitmodules for path 'bin'
No submodule mapping found in .gitmodules for path 'src'

Since they're empty, the easiest way is to delete them and commit:

​$ rm -rf bin
​$ rm -rf src
​$ git commit -a -m 'Removed empty submodules folders'
$ git push

如果您克隆项目,您会发现,这些文件夹实际上是空的:

​$ ls -la bin
total 0
drwxr-xr-x+ 2 fabiopoloni  staff   68  8 Okt 12:18 .
drwxr-xr-x+ 8 fabiopoloni  staff  272  8 Okt 12:18 ..

​$ ls -la src
total 0
drwxr-xr-x+ 2 fabiopoloni  staff   68  8 Okt 12:18 .
drwxr-xr-x+ 8 fabiopoloni  staff  272  8 Okt 12:18 ..

也没有。gitmodules所以它会让你在观看状态/同步错误:

​$ git submodule status
No submodule mapping found in .gitmodules for path 'bin'

​$ git submodule sync
No submodule mapping found in .gitmodules for path 'bin'
No submodule mapping found in .gitmodules for path 'src'

因为它们是空的,最简单的方法是删除它们并提交:

​$ rm -rf bin
​$ rm -rf src
​$ git commit -a -m 'Removed empty submodules folders'
$ git push
git  github