我无法在远程仓库中找到任何文件。
警告如下:
- 按照他们的教程在共享主机(site5)上创建了一个Git仓库。
- 初始化并添加了一个简单的文本文件。好的。
- 克隆到我的本地(WinXP)计算机。好的。
- 删除了本地副本中的测试文件,添加了一些真实文件。好的。
- 提交本地更改。好的。
- 推送到远程服务器。好的。
- MsysGit抛出了一些警告(如下所示),但告诉我我们成功了。
- FTP登录到远程服务器,但文件不在那里。
- 使用PUTTY SSH登录并运行
git status
。它给了我整个列表,但每个文件前面都有“已删除”一词。见下文。
根据我不在任何分支上的提示,我检查了特定的提交。它找到了,但是文件和git status
仍然没有任何反应。它告诉我:
注意:移动到不是本地分支的“9c47b5”
尝试检出主HEAD。没用,它告诉我
-jailshell:/usr/bin/git:没有那个文件或目录
Git状态显示:
[frumwebc@your tanee.com]$ git status
# Not currently on any branch.
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: _notes/dwsync.xml
# deleted: contact-us/_notes/dwsync.xml
# deleted: contact-us/index.html
#
警告如下:
warning: updating the current branch
warning: Updating the currently checked out branch may cause confusion,
warning: as the index and work tree do not reflect changes that are in HEAD.
warning: As a result, you may see the changes you just pushed into it
warning: reverted when you run 'git diff' over there, and you may want
warning: to run 'git reset --hard' before starting to work to recover.
warning:
warning: You can set 'receive.denyCurrentBranch' configuration variable to
warning: 'refuse' in the remote repository to forbid pushing into its
warning: current branch.
warning: To allow pushing into the current branch, you can set it to 'ignore';
warning: but this is not recommended unless you arranged to update its work
warning: tree to match what you pushed in some other way.
warning:
warning: To squelch this message, you can set it to 'warn'.
warning:
warning: Note that the default will change in a future version of git
warning: to refuse updating the current branch unless you have the
warning: configuration variable set to either 'ignore' or 'warn'.
Pushing to fru@67......ee.com
To fru@67......ee.com/26d352f..9c47b55 master -> master
git reset --hard
命令来恢复丢失的文件。 - user229044