问题标签 [reflog]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
git - How can I display dates when local updates were made to a git repo?
For example:
- How can I display when HEAD@{2} was created?
- Given a commit's SHA1, how can I display the date it was pulled into the current repo, rather than (or in addition to) its commit date?
I thought there would be a git reflog
option for this, but as far as I can see, there is not.
git - git rebase abort 并清空 reflog
我愚蠢地中止了一个被遗忘的 rebase,其中包含提交和未提交的更改,所以它把所有东西都吹走了,类似于这样的问题。
我知道 reflog 并立即去那里查看,但是它只包含一个无用的 pre-rebase 状态的散列。到底是怎么回事?如何丢失 reflog 条目?
编辑:响应下面的@kan,这大致是我所做的:
refloga8f06a6 HEAD@{2}: rebase: updating HEAD
现在只包含
git - 包装长 git reflog 行?
git reflog
显示单行描述,将其剪裁在右边距。
如何显示整个 reflog 消息,包装以占用最少的必要行(简短描述为单行)?
git - What is the most robust way to get the name of the reference last pointed to by HEAD?
After an operation that moves HEAD
(such as checkout
, reset
, etc.), you can always get the commit ID that HEAD
pointed to before that operation by running, for instance,
What I'm interested in, though, is getting the name of the reference (if any) that HEAD
last pointed to. Here's an example that illustrates what I want. Let's say my repo looks as follows:
Then I check out the develop
branch by running
and end up with
How can I retrieve the information, from my repo's entrails, that HEAD
was pointing at master
, before that last checkout operation?
This answer suggests extracting the name from the reflog with awk
as a possibility; for instance, with
(thanks to Ed and Etan for their suggestions).
As far as I can tell, that works well enough. It even prints the SHA of the previous commit, in case HEAD
was detached before the last checkout.
However, the OP raises concerns about robustness and backward compatibility in his comment:
I am marking this answer as correct (which it is, technically), for want of a cleaner approach. However, I am not convinced that the string's format being hard-coded into Git's source code is a good thing, as it means it could break unexpectedly (i.e. in a later version of Git).
Are the OP's concerns legitimate? What is the most robust way to do that?
git - git reset --hard 后未暂存的文件消失了
我尝试了git reset --hard HEAD@{n}
from git reflog
,但我丢失了当前未暂存文件的所有内容:'(
未暂存的文件是git add
我做的最后一个文件,在此之前我尝试git reset
了最后一个git commit
.
我所有的文件都消失了,我无法回到git add
上次提交之前的内容:'(
git - 由于 reflog 中的 sha 相同,无法从 Git 恢复提交
我正在尝试恢复代码,因为我不小心切换到 eclipse 中的一个分支并以某种方式丢失了所有数据(我仍然不知道我做了什么)。当我在命令行中打开我的 git reflog 时,我看到:
我正在尝试结帐6dc60f6 HEAD@{14}: commit: fixed class mismatch for integers
,但我所有的检查尝试都转到了6dc60f6 HEAD@{22}: commit: change Db
一个更旧的版本。这是来自git reflog
命令,而不是 git log
,因此签出@{14}
也不起作用。
有没有办法检查最新的提交6dc60f6
或者丢失了?
谢谢。
PS 其他 14 个命令只是我从一个分支切换到另一个分支并再次尝试修复它。
编辑2:
运行git reflog show --no-abbrev
,这是在我执行所有那些淹没 reflog 的检查之前的 repo 的 zip 文件,所以它从 @{0} 开始,注意 2 (HEAD, master) 具有相同的哈希但不同的提交消息:
git - git clone 后获取完整的提交历史
我是一个项目中唯一的开发人员,我在多台计算机上工作,其中一些在 VM 上。在 gitHub 上对我的 repo 进行 git 克隆后,对 reflog 的调用仅在克隆后显示项目。如何更新这个新的克隆仓库以显示完整的历史记录?
git - “git reflog 应该显示什么“ 节目?
我有两个分支,master 和 b1。当我在 b1 上时,“git reflog show”会显示对 b1 的所有更改。但是,在我切换到 master 并运行 'git reflog show b1' 后,它会显示一些不同的东西。'git reflog' 的联机帮助页没有解释 arg <ref> 如何影响输出。
git - 查看过期的 reflog 日志
有什么方法可以查看过期的 reflog 吗?我一直在保持几个月前在本地分支上所做的一些本地提交,并且我通过经常变基来使其与我们的远程分支保持同步。不知何故,我丢失了该分支的所有本地提交,并且无法恢复它,因为 git reflog 没有显示超过某个日期的日志。
git - 为什么我的 git reflog 不回去克隆
我有一个关于 git reflog 的问题:
在我的项目开始时,当我执行 git reflog 时,我能够看到我原来的 git clone 命令的所有步骤。
今天, git reflog 不再返回到 git clone 命令。
更准确地说, git reflog 返回 4143 行,最后几行被截断:
谁能解释我为什么?
有没有办法获得整个reflog?
非常感谢,
朱利安