git : a file in the history without commits on it, 怎么解释呢?

标签 git svn git-rewrite-history

我正在将许多 svn 存储库迁移到许多其他 git 存储库。这些 svn 存储库有超过 113000 次提交。 我最终得到了非常大的 git 存储库,并且我喜欢缩小它们。

我用过script找出最大的物体。这些对象不再位于任何分支中,我想知道它们与哪个提交相关。 我找不到任何东西???

我使用了命令

git log --pretty=oneline --branches -- my_big_file_full_path

但是什么也没返回。 有人可以解释一下为什么这个文件没有关联的提交吗? 如果确实如此,如何删除所有未链接到任何提交的文件?

PS:迁移过程相当繁重,我正在使用 bfg (这太棒了)删除一些已知未使用的文件夹。

最佳答案

使用 BFG 后您是否清理过存储库?正如 BFG 上的“使用”部分所述您应该使用的网站

$ cd some-big-repo.git
$ git reflog expire --expire=now --all
$ git gc --prune=now --aggressive 

删除存储库中不属于任何提交的对象。

关于git : a file in the history without commits on it, 怎么解释呢?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22304095/

相关文章:

git - 如何在 GIT 中查看暂存区中的文件内容?

node.js - 无法让 git 停止跟踪 package-lock.json

git - “git remote add origin”,“set-url origin”和config…有什么区别?

bash - svn 从 bash 脚本提交而不打开编辑器

svn - 使用 teamcity 在 svn 中自动分支

Git:批量更改提交日期

git - 如何使用 git filter-branch 通过 blob SHA1 删除文件?

c++ - 使用 cmake 和 QT 组织多个项目

svn - "The last merge operation tried to add the file ' x.cs' but the file was returned in theworking copy."是什么意思?

git - 如何替换 git 历史文件中的文本?