我在远程仓库上找不到任何文件.
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
#
Run Code Online (Sandbox Code Playgroud)
警告是:
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
Run Code Online (Sandbox Code Playgroud)
当您在Git中推送到远程仓库时,它不会更新该远程仓库的工作副本.这意味着工作副本将与您推送的最后一个版本不同步.为避免这种混淆,建议只推送裸露的回购; 没有工作副本的回购.原因是如果工作副本中的任何内容发生了变化,您将无法收到有关此事件的警告并执行合并,因为您正在推送到远程仓库.
通常,您应该修改工作副本的唯一方法是从其中进行,例如从该工作副本中执行提取或结账.如果您希望在推送时自动检查服务器某处的代码副本,则应设置一个post-receive挂钩,然后进入git pull具有工作副本的存储库.
| 归档时间: |
|
| 查看次数: |
4557 次 |
| 最近记录: |