远程 git 推送中的致命错误
Fatal error in remote git push
我正在尝试将本地项目推送到一个空的 GitHub 存储库(仅在几分钟前创建),但出现了一些错误。
我按照说明 here 创建了我的 GitHub 存储库,并进行了初始本地 git 提交:
git add .
git commit -m "Initial commit" (this was successful)
git remote add origin https://github.com/[name]/[repo].git
git remote -v
到那时一切都很好,但接下来我尝试了这个:
git push -u origin master
并返回以下标准输出:
Counting objects: 8, done.
Delta compression using up to 8 threads.
error: garbage at end of loose object 'b3872d786a175232c101cca4bbd8f2cddde5622d'
fatal: loose object b3872d786a175232c101cca4bbd8f2cddde5622d (stored in .git/objects/b3/872d786a175232c101cca4bbd8f2cddde5622d) is corrupt
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
fatal: write error: Bad file descriptor
error: failed to push some refs to 'https://github.com/[name]/[repo].git'
这是我第一次尝试将本地项目推送到 GitHub,我似乎无法在 GitHub 的站点或 Whosebug 上找到解决我问题的方法.有人知道在这里做什么吗? 运行 OS X.
解决方案: 对我来说相当简单的修复 - 我只需要进入父目录并从那里也 rm -rf .git
。似乎有点 hack-y 解决它的方法,我仍然不太确定我首先做了什么导致了这个问题......
如果有其他人遇到同样的问题,请务必在此处传递!
我正在尝试将本地项目推送到一个空的 GitHub 存储库(仅在几分钟前创建),但出现了一些错误。
我按照说明 here 创建了我的 GitHub 存储库,并进行了初始本地 git 提交:
git add .
git commit -m "Initial commit" (this was successful)
git remote add origin https://github.com/[name]/[repo].git
git remote -v
到那时一切都很好,但接下来我尝试了这个:
git push -u origin master
并返回以下标准输出:
Counting objects: 8, done.
Delta compression using up to 8 threads.
error: garbage at end of loose object 'b3872d786a175232c101cca4bbd8f2cddde5622d'
fatal: loose object b3872d786a175232c101cca4bbd8f2cddde5622d (stored in .git/objects/b3/872d786a175232c101cca4bbd8f2cddde5622d) is corrupt
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
fatal: write error: Bad file descriptor
error: failed to push some refs to 'https://github.com/[name]/[repo].git'
这是我第一次尝试将本地项目推送到 GitHub,我似乎无法在 GitHub 的站点或 Whosebug 上找到解决我问题的方法.有人知道在这里做什么吗? 运行 OS X.
解决方案: 对我来说相当简单的修复 - 我只需要进入父目录并从那里也 rm -rf .git
。似乎有点 hack-y 解决它的方法,我仍然不太确定我首先做了什么导致了这个问题......
如果有其他人遇到同样的问题,请务必在此处传递!