相关疑难解决方法(0)

从git repo中删除'.git'目录?

我正在尝试将git repo从Kiln迁移到Github.我可以添加新的遥控器,但是当我尝试将master推送到新的遥控器时,我收到以下错误:

Counting objects: 8691, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3000/3000), done.
remote: error: object a9ee490ac00987835de30bdbc851da5e8d45d28b:contains '.git'
remote: fatal: Error in object
error: pack-objects died of signal 13
error: failed to push some refs to 'git@github.com:Account/repo.git'
Run Code Online (Sandbox Code Playgroud)

Commit中a9ee490ac00987835de30bdbc851da5e8d45d28b包含以下文件:

.git/
CHANGELOG.md
JSONKit.h
JSONKit.m
README.md
Run Code Online (Sandbox Code Playgroud)

显然有人在过去使用hg,在子目录中检查完整的git仓库.

我想完全杀死该目录,但是从git历史记录中删除该文件时遇到问题.

推送git repo的答案失败了,错误:包含'.git'没有帮助,因为我将repo作为git repo,而不是mercurial repo.

我试过了git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch .git',但是我得到了错误:

Rewrite 7dbd0970d6c79215d11994b4a9b8091b2e954cfb (326/442)error: Invalid path 'Account/Libraries/ShareKit/Submodules/JSONKit/.git/HEAD'
error: Invalid …
Run Code Online (Sandbox Code Playgroud)

git mercurial git-filter-branch git-rewrite-history

22
推荐指数
2
解决办法
4143
查看次数

推送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
查看次数