git show <commit> --onon not not on online

Tim*_*vis 15 git msysgit

我正在使用mysysgit的1.8.3版本,似乎--oneline命令不会给我每次提交一行,我也得到所有的diff行.

git show HEAD --oneline
Run Code Online (Sandbox Code Playgroud)

乃至 git show HEAD --pretty="%h %s"

不要只给一行.

(注意:同时使用git bash和posh git的结果)

我想要show --oneline的原因是我想把一个rev-list查询的结果从posh git中输入它.

git rev-list <somestuff> | %{git show $_ --oneline}
Run Code Online (Sandbox Code Playgroud)

dyn*_*yng 13

可以

git log HEAD --oneline --no-walk
Run Code Online (Sandbox Code Playgroud)

是你想要的.

顺便说一句,有--pretty--onelinegit loggit rev-list,也许管道是不必要的.

  • 然而答案并没有解释为什么`git show HEAD --oneline`不会产生文档中所述的输出:`<sha1> <title line>这是为了尽可能紧凑. (16认同)

小智 6

我想这会做你想要的 git show --no-patch --oneline