相关疑难解决方法(0)

Git 远程:错误:对象包含“.git”

推送到 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 github

6
推荐指数
0
解决办法
2355
查看次数

推送git repo失败并显示错误:包含'.git'

我使用hg-fast-export工具将一些mercurial repos转换为git,虽然所有这些都转换得很好,但是当我按下repo时会产生以下错误.

$ git remote add origin git@github.com:asdf/zxcv.git
$ git push -u origin master
Counting objects: 7840, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2817/2817), done.
error: object 324f9ca2aaae7b1d716db3fc31c02d391c1c2c16:contains '.git'
fatal: Error in object
error: pack-objects died of signal 13
error: failed to push some refs to 'git@github.com:asdf/zxcv.git'
Run Code Online (Sandbox Code Playgroud)

"包含'.git'"错误有非常广泛的术语,找不到任何文档,因此我尝试在原始仓库中搜索现有的".git"文件夹,我做了.有一个subsubsub文件夹,其中包含我使用git rm删除的旧git存储库的实例,但问题仍然存在.

无论如何我可以把它推到github或新的清洁回购是唯一的选择吗?

任何帮助在此赞赏.谢谢!

git mercurial

3
推荐指数
1
解决办法
1369
查看次数

标签 统计

git ×2

github ×1

mercurial ×1