可能重复:
'git pull origin mybranch' leaves local mybranch N commits ahead of origin. Why?Git - “你的分支在3次提交之前领先于'origin/master'。”
我得到这个信息的混帐
>git status
# On branch master
# Your branch is ahead of 'origin/master' by 3 commits.
#
nothing to commit (working directory clean)
,当我试图推动,我得到这个:
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>'
我一直在使用Google这一点,(例如,这里有一个关于它的stackoverflow问题 - 'git pull origin mybranch' leaves local mybranch N commits ahead of origin. Why?),一般建议似乎是做一个拉,然后推。但是这对我不起作用 - 拉我告诉我我是最新的。我也试过'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)
如果有帮助的人。
我也尝试在我们的Web服务器上添加一个虚拟文件(它也检查出主服务器),提交并推送它,然后在本地将其拉下。这一切运行良好。但我仍然无法推动。任何人都可以告诉我我需要做什么来解决这个问题吗?我甚至不知道我已经快速转发到存储库的意思是什么。
欢呼,最大
编辑 - 为ebneter和丹(感谢)
> 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
gitk的屏幕抓取是http://dl.dropbox.com/u/846812/gitk.png
- 我是新来的git这样我就可以这不是很好解释,但我想知道是否作为根(在顶部的第6行),'合并分支大师......'做的提交可能已经把事情搞砸了。我不记得做了承诺为根本,困惑......
丹 - 我认为你是对的:我得到当我试图把误差
error: unable to create temporary sha1 filename ./objects/05: File exists
fatal: failed to write object
error: unpack failed: unpacker exited with error code
编辑 - 这从另一个计算器问题,我前面提到的实际上确实解决这个问题发表评论:
远程Git单独(出正确的地址为GitHub库)是不是 不够。为了避免在 git pull之后出现“您的分支在前”警告消息,您还需要首先为分支定义远程名称。 因此,我的建议:输入git config branch.master.remote yourGitHubRepo.git,然后尝试git pull和git status,看看 问题是否仍然存在。 - VonC 11月16日20:22
尝试运行'gitk --all'来获取您的提交内容的视觉。 – noah 2010-02-26 15:26:30
您收到的错误通常表明遥控器上出现了问题。但是,您似乎暗示您可以从您的Web服务器推送。是对的吗?你可以显示你的配置文件的全部内容(git config -l)吗? – ebneter 2010-02-26 23:38:23
有一个答案提供[这里](http://stackoverflow.com/questions/1741143/git-git-pull-origin-mybranch-leaves-local-mybranch-n-commits-ahead-of-origin) – Surya 2010-02-27 01:44:08