bil*_*999 3 git r github git-pull rstudio
git pull当我在 Mac 上的终端中运行时,如何解决此错误?
remote: Enumerating objects: 115, done.
remote: Counting objects: 100% (115/115), done.
remote: Compressing objects: 100% (66/66), done.
remote: Total 104 (delta 71), reused 63 (delta 30), pack-reused 0
Receiving objects: 100% (104/104), 3.92 MiB | 3.16 MiB/s, done.
Resolving deltas: 100% (71/71), completed with 9 local objects.
fatal: bad object refs/heads/main (1)
error: https://github.com/[...domain name...]/website.git did not send all necessary objects
Run Code Online (Sandbox Code Playgroud)
背景是我有一个网站,通常运行没有问题。我在 RStudio 中创建它并与 github 同步。Netlify 就是从这里开始的。以下是设置的基础: https: //www.apreshill.com/blog/2020-12-new-year-new-blogdown/。
在 RStudio 中进行更改后,我通常可以在 RStudio 内提交并推送更改。但这一次,它是这样说的:
! [rejected] HEAD -> main (non-fast-forward)
error: failed to push some refs to 'https://github.com/[domain name]/website.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again
Run Code Online (Sandbox Code Playgroud)
因此,我转到终端并将工作目录更改为存储和运行文件的位置git pull。然后我收到fatal: bad object refs/heads/main (1)上面提到的错误。基于如何处理 git gc fatal: bad object refs/remotes/origin/HEAD 错误?,我尝试git gc得到这个错误:
error: bad ref for .git/logs/HEAD (1)
error: bad ref for .git/logs/refs/heads/main (1)
fatal: bad object refs/heads/main (1)
fatal: failed to run repack
Run Code Online (Sandbox Code Playgroud)
我也尝试过git remote set-head origin --auto,然后git gc得到与上面相同的错误。
如果我运行cat .git/refs/remotes/origin/HEAD,它会显示:refs/remotes/origin/main。
最后,我git reset --hard之前尝试过git pull,这给了我最初的错误。
我不知道此时该怎么办。我完全可以从远程服务器获取所有内容并重做本地更改。
| 归档时间: |
|
| 查看次数: |
3488 次 |
| 最近记录: |