【问题标题】:How to see locally committed messages, but not pushed into git [duplicate]如何查看本地提交的消息,但不推送到 git [重复]
【发布时间】:2016-06-27 04:01:10
【问题描述】:

我知道如何通过git log 命令在 git 中查看提交消息,但它会列出所有提交的消息。我想要的是那些尚未推送的已提交消息,这意味着仅已提交但未推送。我们对此有什么命令吗?我也有一个解决方案,我们可以在 github 中查看所有提交,同时我们可以使用git log 命令进行检查。区别将是我的输出,但我希望通过命令来实现。

【问题讨论】:

    标签: git commit


    【解决方案1】:

    您可以使用git-log的形式来显示两个分支之间的区别:

    git log origin/master..master
    

    More information关于git-log的不同形式。

    更好的是(扩展 @PetSerAL 的评论)您可以创建一个方便的别名来查看相同的信息:

     git config --global alias.justLocal "log @@{u}.."
    

    所以,无论何时您想查看结果:

    git justLocal
    

    【讨论】:

    • 不错。我想到了git cherry(不要与cherry-pick 混淆)。 git cherry -v origin/master master 显示 master 中尚未在 origin/master 中的所有提交,前缀为 +。但是git log,尤其是。 git log --oneline更好读。
    猜你喜欢
    • 2013-04-25
    • 2011-01-02
    • 2019-02-09
    • 2016-03-01
    • 2012-09-17
    • 2013-06-15
    • 1970-01-01
    • 1970-01-01
    • 2014-05-06
    相关资源
    最近更新 更多