- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
文件在那里,git 只是告诉我它们已从存储库中删除。这可能是 Github 问题吗?
我已经导航到几天未处理的项目文件夹,并且像往常一样运行:
git status
但是,状态显示我的所有文件都已删除,而不是看到 1 或 2 个文件。然后,在“未跟踪文件”中,它显示了我在应用程序根目录中需要添加的所有文件和目录。
我不明白发生了什么,但我很担心自上次提交以来我所做的任何工作都消失了。
我用 git k
打开了 git log,在最上面我看到了:
Local changes checked in to index but not committed.
在我看到的正下方:
master remotes/origins/master
注意:这个项目是针对github数据库的。
这是 git status
命令的输出:
➜ mcp5_mobile git:(master) ✗ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
deleted: .gitignore
deleted: .rspec
deleted: Gemfile
deleted: README
deleted: README.md
deleted: Rakefile
deleted: app/assets/images/MSDS_icon_rgb.jpg
deleted: app/assets/images/MSDS_icon_rgb.png
deleted: app/assets/images/addtocart.gif
<Continues to list every single file in the app. Over 1,100 files.>
Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitignore
.rspec
Gemfile
README
README.md
Rakefile
app/
autotest/
colorpicker.css
config.ru
config/
db/
deploy/
doc/
eye.js
features/
layout.css
lib/
public/
sample.xml
script/
spec/
termios/
test/
vendor/
最佳答案
这强烈建议您(或您间接调用的东西)删除或至少重命名 .git/index
:1
$ ls
LICENSE.txt x.txt
$ git status
On branch master
nothing to commit, working directory clean
$ mv .git/index .git/xindex
$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
deleted: LICENSE.txt
deleted: x.txt
Untracked files:
(use "git add <file>..." to include in what will be committed)
LICENSE.txt
x.txt
$ mv .git/xindex .git/index
$ git status
On branch master
nothing to commit, working directory clean
在上面,我通过放回 index
文件来恢复,但如果它真的消失了,你可以使用 git reset< 从
的 HEAD
提交中重建它--mixed
(默认)模式:
$ rm .git/index
$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
deleted: LICENSE.txt
deleted: x.txt
Untracked files:
(use "git add <file>..." to include in what will be committed)
LICENSE.txt
x.txt
$ git reset -- .
$ git status
On branch master
nothing to commit, working directory clean
[另外:您不需要 -- .
因为它们也是默认值。这更多是为了强调我们正在重置 .
中的每个路径,即 HEAD
提交中的路径。当然,我通过未明确指定 HEAD
来使用默认到 HEAD
的提交操作...]
1或者,也许您确实将环境变量 GIT_INDEX
设置为指向某个奇怪的地方。当GIT_INDEX
未设置时,Git 使用.git/index
,因此如果设置了它,将会覆盖默认值。
关于git - 为什么我所有的 git 存储库突然显示所有内容都已删除?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23189193/
无论我在做什么,我都会得到这个输出,但模拟器不会启动,新创建的模拟器也不会启动。我在 Windows 下: 警告:./android/base/files/IniFile.cpp:155:无法处理 .
我用 package.json NPM 脚本中像这样的变量: // package.json { "version": "0.12.1", "scripts": { "get-vers
几天前,Facebook 与我们网站的连接突然停止工作,代码没有任何更改??? Facebook 做了一些改变??? http://www.presbium.sk/vstup-pre-uchadzac
我习惯于 grunt build 任务成功完成,但由于我将我的项目编辑与其他开发人员同事合并,它突然失败并出现我以前从未见过的错误: grunt build Loading "imagemin.js"
我不明白这个。突然之间,我无法使用 iOS 9.0 中引入的 UIUserNotificationActionResponseTypedTextKey 标识符来访问通知中的文本输入消息。 Xcode
在我调用某个 Google 的 Youtube 库后,我的应用程序在其回调之一后突然变得完全没有响应。 无响应意味着无法点击所有 UI 组件。 在 iOS 中是否有这样的东西可以禁用整个屏幕完全不响应
bool queueIsFull(int rearPointer) { if(rearPointer==9) return 1; else return
我正在使用 PHP、Apache 和 MySQL 开发 Web 应用程序。在过去的一年中,此应用程序的响应时间一直不错。昨天,应用程序在 Firefox 上突然变得非常慢(完整的页面加载,包括 CSS
几个小时后,从控制台发出的 PHP 命令不再接受本地路径。例如在 laravel 中我总是给出命令 php artisan 但从今晚开始我收到了以下回复 Status: 404 Not Found C
我有一个 session WCF 服务,它生成一个进程并在调用 IsInitiating 操作时打开一个到该进程的命名管道。当调用 IsTerminating 操作时,服务会沿着管道发送一条消息,通知
类似的问题已经回答了好几次,我确实检查了其中的许多问题。这是不同的,请继续阅读。 我在 strings.xml 中定义了大量(大量)字符串,并带有多个格式参数。例如: %s and also %s 这
我有一个简单的消息机器人,它是根据 Messenger 平台指南设置的。在过去的几个月里,它一直运行良好,每天发送大约六条消息。我根本没有碰它,但是突然,发送消息,即调用 https://graph.
我正在使用 Unity 开发一款简单的 3D 手机游戏。我的目标是在没有垂直同步的情况下达到 30 FPS。我的游戏在所有 iOS 设备上运行良好,没有发热和节流,但有奇怪的 FPS 下降。 FPS
我们有一个自定义小部件,多年来一直运行良好,直到上周。 看来 Json 回调现在仅适用于播放列表,不适用于轨道。 播放列表 /**/jQuery31108094578850496614_1482167
-bash:/Users/winchenzo/git-completion.bash: 没有那个文件或目录 -bash:/Users/winchenzo/git-prompt.sh: 没有那个文件或目
编辑:重启解决了问题。我仍然想知道最初是什么原因造成的,因为这种情况以前发生过一次,但我不记得当时我做了什么来修复它(当时重新启动并没有解决问题)。 我 cd 到包含我要编辑的文件的文件夹,然后从命令
我刚刚注册是因为我突然遇到了一个问题,目前为止运行良好的代码我之前在这里找到了一些非常好的答案。希望你们能再次帮助我,这次甚至是投票;) $sql='SELECT projektKurz, proje
我制作了一个小程序,它在 tcp 套接字上监听和发送线路,并将接收到的信息附加到 JTextArea。我用它在 Minecraft 服务器上聊天,而无需打开游戏。 我昨晚工作得很好,但当我起床时却不工
感谢您在这里查看我的问题。 我正在使用 Glide 从 Firebase 存储中获取图像,基本上我是在使用 url 从存储中获取图像。第一天它工作正常但突然停止获取图像。我没有碰代码。我检查了很多答案
FCM 通知已到达所有 iOS 设备。但通知在大约 1 年前注册的某些设备上不起作用。 FCM token 和 APNs token 似乎没有变化。为什么没有到达通知? FCM token 是否必须过
我是一名优秀的程序员,十分优秀!