在克隆之前删除提交(忘记 --depth 1)

Remove commits before clone (forgot --depth 1)

我忘记在开始项目之前将 --depth 1 添加到我的克隆中。有没有办法删除克隆之前的所有提交?

使用 file:// 协议克隆您的 local 存储库,如果您在克隆后进行了五次提交,请使用 --depth 选项和 6.

git clone file://C:/Users/<user>/Documents/my-repo --depth 6 my-repo2

现在您所处的情况与您最初使用 --depth 1 进行克隆时的情况相同。