0

我得到了一个不在 reflog 中的悬空提交(或者我用错了),并且不会随git gc. 这就是我的意思:

% git fsck
Checking object directories: 100% (256/256), done.
Checking objects: 100% (5425/5425), done.
dangling commit e681384da8babd4524f545bd880dfc602d271e45
dangling blob 77835dc1395f57d359d81f2c240d02a6ff1e9a69
...

% git reflog | grep e681

% git gc
Counting objects: 5425, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (1585/1585), done.
Writing objects: 100% (5425/5425), done.
Total 5425 (delta 2086), reused 5425 (delta 2086)

% git fsck
Checking object directories: 100% (256/256), done.
Checking objects: 100% (5425/5425), done.
dangling commit e681384da8babd4524f545bd880dfc602d271e45
dangling blob 77835dc1395f57d359d81f2c240d02a6ff1e9a69
...

也没有什么可以为我解释它:

% git config gc.reflogExpireUnreachable

% git config gc.pruneExpire

我看到提交是一个还原,并且历史可以追溯到早期:

% git log e681384da8babd4524f545bd880dfc602d271e45 --oneline | tail -n 2
b50e1de base file structure
9a4b3af first commit

但是为什么这个提交不会消失呢?

我很想知道这一点,因为它对我来说毫无意义:D

4

0 回答 0