简体   繁体   English

从Kiln迁移到github,由于在历史记录中包含.git文件夹而导致git错误

[英]Migrating from Kiln to github, git errors out on having .git folder in history

Our source has been through SVN, then Mercurial, and now git. 我们的来源是通过SVN,然后是Mercurial,现在是git。 When we converted from Mercurial to Git in Kiln, we didn't have any issues. 当我们在窑中从Mercurial转换为Git时,没有任何问题。 However now that we are moving over to github we are getting these errors: 但是,现在我们移至github,我们遇到了以下错误:

remote: error: object f2371b54e17a355e23e06649d17b19e7e96130ab:contains '.git'

This is because in our history we did have some git projects in our source tree. 这是因为在我们的历史中,我们在源代码树中确实有一些git项目。 So now I'm trying to prune those out with: 因此,现在我尝试通过以下方式修剪这些内容:

git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch .git' --prune-empty --tag-name-filter cat -- --all

I've read several questions/FAQ on this, but I wonder if because we're trying to get a git folder removed if that's the problem. 我已经阅读了几个问题/ FAQ,但是我想知道是否是因为这是问题所在,因为我们正在尝试删除git文件夹。 I'd love to get some feedback. 我希望得到一些反馈。

I wonder if because we're trying to get a git folder removed if that's the problem 我想知道是否是因为问题,因为我们正在尝试删除git文件夹

No, removing those folders (with BFG as you saw ) is the solution, not the problem. 不,删除这些文件夹( 如您所见带有BFG )是解决方案,而不是问题。

Trying to push a repo with .git inside to a GitHub repo is likely to trigger that error message, because it means you are pushing nested repos which have been incorrectly versioned in the parent repo. 尝试将内部带有.git的存储库推送到GitHub存储库中可能会触发该错误消息,因为这意味着您正在推送嵌套存储库,而该存储库在父存储库中的版本不正确。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM