【问题标题】:How do I print time stamp in git bash after executing each git command?执行每个 git 命令后如何在 git bash 中打印时间戳?
【发布时间】:2019-01-05 10:31:56
【问题描述】:
$ git pull origin develop
21/04/2016 20:15:33

我希望打印这样的内容以了解我何时执行命令。

【问题讨论】:

标签: linux bash git shell terminal


【解决方案1】:

您可以在 ~/.bashrc 文件中定义别名,如下所示:

alias git='date && git'

【讨论】:

    【解决方案2】:

    一种解决方案是在 bash 提示符中添加时间戳。为此,您可以为您的 shell 设置 PS1PS2 环境变量。阅读https://askubuntu.com/questions/193416/adding-timestamps-to-terminal-prompts 了解有关如何执行此操作的更多详细信息。

    【讨论】:

      猜你喜欢
      • 2015-05-22
      • 1970-01-01
      • 2020-11-07
      • 2019-04-10
      • 2021-12-17
      • 2019-08-17
      • 2017-12-20
      • 2022-07-09
      相关资源
      最近更新 更多