【发布时间】:2018-06-26 16:40:30
【问题描述】:
使用git diff --name-status 命令,我可以看到具有如下文件状态的文件名:
M .bashrc
D .ghc/.ghci.conf.un~
D .ghc/ghci_history
M .life
A .profile
M .spacemacs
使用git diff --stat 我可以看到行数和文件更改的统计信息:
.bashrc | 3 ++-
.ghc/.ghci.conf.un~ | Bin 13912 -> 0 bytes
.ghc/ghci_history | 100 --------------------------------------------------------------------------------------------
.life | 2 ++
.profile | 23 +++++++++++++++++++++
.spacemacs | 3 +++
有什么方法可以合并两个命令的输出吗?我想要这样的东西:
M .bashrc | 3 ++-
D .ghc/.ghci.conf.un~ | Bin 13912 -> 0 bytes
D .ghc/ghci_history | 100 --------------------------------------------------------------------------------------------
M .life | 2 ++
A .profile | 23 +++++++++++++++++++++
M .spacemacs | 3 +++
当然,我可以通过字符串调用两个命令然后操作字符串来手动完成。但我不确定这些命令的输出有多可靠和一致。也许它记录在某处。能否请您提供一个 shell 命令,让我可以从终端查看这些差异?
【问题讨论】: