推送到 Github 时,我遇到以下错误
Counting objects: 16780, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (10936/10936), done.
remote: error: object f4ac3e31afb08298c6cd2ac04c6853940bbab3f6:contains '.git'
remote: fatal: Error in object
error: pack-objects died of signal 13
error: failed to push some refs to 'git@github.com:omarshammas/repo_name.git'
Run Code Online (Sandbox Code Playgroud)
这个 git 对象f4ac3e31afb08298c6cd2ac04c6853940bbab3f6抱怨它包含.git文件夹。我想这是从 mercurial 迁移到 git 时引起的。
无论如何,我尝试.git使用从历史记录中删除文件夹
git filter-branch --force --index-filter \
'git rm -r --cached --ignore-unmatch .git' \
--prune-empty --tag-name-filter cat -- --all
Run Code Online (Sandbox Code Playgroud)
但我仍然遇到错误。
我没有遇到推送到其他遥控器(例如(bitbucket / heroku))的问题。Github 显然有更严格的验证。
不确定它是否重要,但抱怨的对象是树对象。
> git show f4ac3e31afb08298c6cd2ac04c6853940bbab3f6
tree f4ac3e31afb08298c6cd2ac04c6853940bbab3f6
.git/
MIT-LICENSE
README.textile
assets/
init.rb
install.rb
lib/
tasks/
Run Code Online (Sandbox Code Playgroud)
谢谢