1
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Allen\Documents\GitHub\project2-pd7 [master]> git status
# On branch master
# Your branch is ahead of 'origin/master' by 5 commits.
#
nothing to commit, working directory clean
C:\Users\Allen\Documents\GitHub\project2-pd7 [master]> git push
Counting objects: 36, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (15/15), done.
Writing objects: 100% (30/30), 3.93 KiB, done.
Total 30 (delta 8), reused 1 (delta 0)
error: unpack failed: index-pack abnormal exit
To https://github.com/stuycs-ml7/project2-pd7.git
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'https://github.com/stuycs-ml7/project2-pd7.git'

我仍在尝试用 github 找到我的海腿,但这些持续存在的问题让我很生气。任何人都可以用普通话解释解决方案以便我理解吗?

4

3 回答 3

2

您的历史记录与远程分支的历史记录不同。可能有人自您上次提交以来已将提交推送到远程分支git pull。解决方案是:

git pull

或者

git pull --rebase

后者尝试重写您的提交,以便它们出现在分支的顶端,重新基于远程分支的历史记录。前者在您的远程分支历史记录之间进行简单合并。

于 2012-12-03T13:25:40.977 回答
1

自您上次结帐/拉取以来,您班上的其他一些学生推送了一些修订。

正如 hd1 指出的那样,您最好的选择是两者之一git pull,这可能会创建一个合并提交,之后您可能必须显式地git commit进行合并。我更喜欢git pull --rebase在运行之前对更改进行线性化git push

git log --graph从命令行运行 a以获得本地存储库当前状态的良好可视化。

git fetch不尝试合并或重新设置当前更改的情况下拉下远程分支。这将允许您检查远程存储库的状态git log --graph origin/master

于 2012-12-03T07:31:35.193 回答
0

git pull在你之前试试git push

于 2012-12-03T07:21:06.950 回答