Git reflog 并做一个新的克隆?

标签 git

如果您想跟踪 git 存储库中发生的更改,您可以使用 https://git-scm.com/docs/git-reflog例如如果一个分支被本地/远程意外删除,如何恢复它?

但据我了解,git reflog 仅在本地存储库的上下文中才有意义。这意味着每次你做一个全新的克隆时,所有分支的 git reflog 都是空的。对吗?

最佳答案

是的,没错。如果你克隆一个项目,reflog 是空的,第一个条目是例如:

fd7cb08 HEAD@{0}: clone: from https://github.com/xxxx

Reference logs, or "reflogs", record when the tips of branches and other references were updated in the local repository.

https://git-scm.com/docs/git-reflog

关于Git reflog 并做一个新的克隆?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39125225/

相关文章:

git - 在Windows上运行的Jenkins Release神器作业在Git push命令中失败

c# - 从已部署的应用程序中检索最后一次提交 ID/修订号

git - 如何查找哪个 github 存储库正在使用 LFS

git - 如何记录每个分支的最后一次提交时间?

git - 关于 git 强制推送

node.js - 无法强制将文件提交到 Heroku

git - git 如何将当前分支推送到另一个远程/源?

git - 摆脱旧 git 分支的 '... does not point to a valid object'

git - 第一次上传到github的问题

git - 从我在本地没有的远程 git 历史记录中删除一个提交