github - git reflog recovery
怪我咯
怪我咯 2017-05-02 09:37:34
0
2
791

Can the git local repository only have committed content and can be restored through reflog no matter how many rebase, rest --hard and other operations are performed afterwards?

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(2)
漂亮男人

No, because reflog data is stored in the .git/logs/ directory, and git reflog operations cannot be performed when there is no content in this directory.
So as long as you ensure that this directory is not cleared, you can perform dangerous operations at will?
It still doesn’t work, because git will automatically run gc from time to time, and git’s gc task will delete objects that are not referenced by any commit and have existed for a period of time (several months).

给我你的怀抱

Don’t just do some dangerous operations just thinking that you can recover. It will be a tragedy if one day you can’t recover. You must understand that the best effect of tools depends on people. The most important thing is to maintain the standardization of the collaboration process. .
Please refer to: Git usage standard process

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template