代码之家  ›  专栏  ›  技术社区  ›  Shuman

如何完全删除所有git提交,包括获取的对象?

  •  0
  • Shuman  · 技术社区  · 6 年前

    我想在测试时再次获取git svn。因为我第一次运行它时,一切都很顺利,除了我在 --authors-file ,因此一些作者最终在git日志中没有全名,然后我再次添加缺少的名称,并清除所有提交,然后运行 git svn fetch 同样,但它没有获取数据并再次创建提交。这次,它完成时没有错误,并且没有创建提交。

    为什么以下方法不起作用?

    git update-ref -d HEAD
    git co --orphan mybranch
    git reflog expire --expire=now --all && git gc --prune=now --aggressive
    # objects did not go away, it seems they are packed instead
    # now git svn fetch again, it uses existing data  in .git/objects
    
    0 回复  |  直到 6 年前