我的计算机上有一个编程项目,前段时间我想在项目中进行备份和在家工作。为此,我在同一台工作计算机上创建了一个裸git存储库,我可以毫无问题地推/拉。
几周以来,当我尝试将新工作目录中的新更改推送到git-repository时,我收到一条错误消息。当我尝试第二次推动时它起作用。这是它的外观:
>>> git status
On branch polymult
Your branch is up-to-date with 'origin/polymult'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: myFile.cpp
no changes added to commit (use "git add" and/or "git commit -a")
>>>
>>>
>>>
>>> git commit -am'Test'
[polymult 84ff057] Test
1 file changed, 1 insertion(+)
>>>
>>>
>>>
>>> git push
Counting objects: 3, done.
Delta compression using up to 24 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 301 bytes | 301.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0)
error: unpack should have generated 84ff057984e1344202cea2f788534849bf2b9787, but I can't find it!
To ../../myProject.git/
! [remote rejected] polymult -> polymult (bad pack)
error: failed to push some refs to '../../myProject.git/'
>>>
>>>
>>>
>>> git push
Counting objects: 3, done.
Delta compression using up to 24 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 301 bytes | 301.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0)
To ../../myProject.git/
7c81cb5..84ff057 polymult -> polymult
>>>
有人知道导致此行为的原因以及解决方法吗?
答案 0 :(得分:0)
可以通过运行以下命令来验证对象的连通性和有效性吗?
git fsck --full