git Github 未检测到新文件夹
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21006984/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Github doesn't detect new folder
提问by Dustin Snider
I am working on a windows 8 laptop with github client connected to my remote bitbuckket git. I recently built the mobile version of my website localhost/WEBSITENAME/mobile
我正在 Windows 8 笔记本电脑上工作,github 客户端连接到我的远程 bitbucket git。我最近构建了我的网站 localhost/WEBSITENAME/mobile 的移动版本
been working in localhost/WEBSITENAME now in loaclhost/WEBSITENAME/mobile
现在在 localhost/WEBSITENAME 工作在 loaclhost/WEBSITENAME/mobile
Now github doesn't detect the new mobile folder so I can't push my mobile files. Any help would be great as I have another developer waiting for these files.
现在 github 没有检测到新的移动文件夹,所以我无法推送我的移动文件。任何帮助都会很棒,因为我有另一个开发人员在等待这些文件。
采纳答案by meda
If your directory structure looks like this:
如果您的目录结构如下所示:
/------WebsiteName/
|
|-----------/Mobile/
Then make sure you are in WebsiteName directory, then run git status
然后确保您在 WebsiteName 目录中,然后运行 git status
If you are still getting the same error then run the following in order:
如果您仍然遇到相同的错误,请按顺序运行以下命令:
git init
git status //here you should see the mobile folder and its files
git add --all
git commit -am "committing"
git push --all
回答by rixmit
Git will ignore empty folders. Make sure at least one file is present in the new folder in the Git repository, or else you are not able to add it.
Git 将忽略空文件夹。确保 Git 存储库中的新文件夹中至少存在一个文件,否则您将无法添加它。
回答by jtanaa
In that case you should check whether you have put /mobile
in your .gitignore file. Or the solution provided by @meda would work.
在这种情况下,您应该检查是否已放入/mobile
.gitignore 文件。或者@meda 提供的解决方案会起作用。
回答by Jay Jay Jay
Make sure that there is no .gitignore file anywhere in the folder that is blocking the specific folder you are trying to add or the file or its extension
确保文件夹中的任何位置都没有 .gitignore 文件阻止您尝试添加的特定文件夹或文件或其扩展名