将 core.logAllRefUpdates 设置为 true 的裸存储库中的 git reflog 不返回任何内容

标签 git git-reflog

我已经使用 git clone --mirror 镜像了一个 git 仓库, 然后设置 git config core.logAllRefUpdates true ,然后更新为 git fetch -p .

在托管存储库的服务器上,如果我运行 git reflogrepository.git目录,我没有输出。

core.logAllRefUpdates 的文档指出 refs 被放置在 $GIT_DIR/logs/<ref> 中,但我没有日志目录。我需要手动创建吗?

core.logAllRefUpdates

Enable the reflog. Updates to a ref is logged to the file "$GIT_DIR/logs/", by appending the new and old SHA-1, the date/time and the reason of the update, but only when the file exists. If this configuration variable is set to true, missing "$GIT_DIR/logs/" file is automatically created for branch heads (i.e. under refs/heads/), remote refs (i.e. under refs/remotes/), note refs (i.e. under refs/notes/), and the symbolic ref HEAD. If it is set to always, then a missing reflog is automatically created for any ref under refs/.

最佳答案

不,您不必创建该目录。对于裸存储库,只需通过

启用 reflogs
git config core.logAllRefUpdates true

支持值truealways。然后查看分支类型的reflog

git reflog <branch>

查看更多详情 here , 和 documentation page of git reflog , 对于其他配置选项。

关于将 core.logAllRefUpdates 设置为 true 的裸存储库中的 git reflog 不返回任何内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48769443/

相关文章:

git: 'credential-cache' 不是 git 命令

Git 仍在尝试推送被忽略和删除的文件

macos - Git:删除当前分支并丢失 reflog

git - 当输出被 push 管道时如何获得完整的 git reflog 输出

git - 未出现在任何分支中但在 "git show"中可用的提交发生了什么

git - 当目录已经移动到不同目录时如何在git中 merge 文件

git - 分支的请求请求包含其他分支的提交

git - 从特定的 repo 哈希或标签创建一个 git 子模块

git - git reflog 中的第二列是什么?

git checkout 上一条