我在git中获取此信息
>git status
# On branch master
# Your branch is ahead of 'origin/master' by 3 commits.
#
nothing to commit (working directory clean)
Run Code Online (Sandbox Code Playgroud)
并且,当我尝试推动时,我得到了这个:
fatal: failed to write object
error: unpack failed: unpacker exited with error code
To ssh:<my repository>
! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'ssh:<my repository>'
Run Code Online (Sandbox Code Playgroud)
我一直在谷歌上搜索一下,(例如这里有一个关于它的stackoverflow问题 - 'git pull origin mybranch'让本地mybranch N在原点之前提交.为什么?)并且一般的建议似乎是做拉然后一个推.但这对我不起作用 - 拉动告诉我,我是最新的.我也试过'git fetch origin'(没什么).我也尝试过:
> git remote show origin
* remote origin
URL: ssh://<my repository>
HEAD branch: master
Remote branch:
master tracked
Local branch configured for 'git pull':
master merges with remote master
Local ref configured for 'git push':
master pushes to master (fast forwardable)
Run Code Online (Sandbox Code Playgroud)
如果有帮助任何人.
我还尝试在我们的Web服务器上添加一个虚拟文件(也检查出master),提交并推送它,然后在本地将其拉下来.一切都很好.但我仍然无法推动.谁能告诉我我需要做些什么来解决这个问题?我甚至不知道说我相对于存储库快速转发是什么意思.
干杯,最大
编辑 - 为ebneter和dan(谢谢)
> git config -l
user.name=Max Williams
push.default=tracking
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=ssh://<my repo url>
branch.master.remote=origin
branch.master.merge=refs/heads/master
Run Code Online (Sandbox Code Playgroud)
gitk的屏幕抓取位于http://dl.dropbox.com/u/846812/gitk.png
丹 - 我认为你是对的:我试图推动的错误是
error: unable to create temporary sha1 filename ./objects/05: File exists
fatal: failed to write object
error: unpack failed: unpacker exited with error code
Run Code Online (Sandbox Code Playgroud)
编辑 - 我之前提到的其他stackoverflow问题的这个评论确实解决了它:
单独使用git remote(显示GitHub repo的正确地址)是不够的.为了避免在git pull之后出现"Your branch is ahead"警告消息,首先还需要为分支定义远程名称.因此我的建议是:键入git config branch.master.remote yourGitHubRepo.git,然后尝试git pull和git状态,看看问题是否仍然存在. - VonC 11月16日20:22
看起来您遇到的问题与"远程拒绝"行中提到的"解包器错误"有关.由于某种原因,远程端无法解压缩发送给它的对象.这可能是由许多事情引起的.你可以尝试一些事情:
git fsck --full
Run Code Online (Sandbox Code Playgroud)
在本地和远程运行(如果可能).
git repack remotes/origin/master
Run Code Online (Sandbox Code Playgroud)
在本地仓库上运行它.
如果这些都没有解决问题,请尝试使用Google搜索git "unpacker error"其他想法.我个人从来没有经历过这个问题,所以不幸的是我能给出的所有建议.
| 归档时间: |
|
| 查看次数: |
30214 次 |
| 最近记录: |