【问题标题】:How to get the full git reflog output when the output is pushed into a pipe将输出推入管道时如何获取完整的 git reflog 输出
【发布时间】:2019-12-22 15:10:24
【问题描述】:

如何将git reflog 的输出输入到其他程序中,而无需复制+粘贴。当我通过管道输出时,分支名称突然消失了:

$ git --no-pager reflog
8c394ee (HEAD -> master) HEAD@{0}: commit: Bar
cbf7358 HEAD@{1}: commit (initial): Foo

$ git --no-pager reflog | cat
8c394ee HEAD@{0}: commit: Bar
cbf7358 HEAD@{1}: commit (initial): Foo

我只是希望能够grep 输出中的特定分支名称,这是行不通的,因为当我尝试这样做时 git 会禁用分支名称。

【问题讨论】:

    标签: git git-reflog


    【解决方案1】:
    git --no-pager reflog --decorate | cat
    

    【讨论】:

    • 很遗憾,我的客户(2.20.1 和 2.23.0.rc2.8.gff66981f45)不懂 --decorate
    • 对不起,我的错:这是reflog --decorate,而不是git --decorate
    猜你喜欢
    • 2016-10-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-13
    相关资源
    最近更新 更多