我知道有 git gui 类似于 sourcetree 和 github 用于桌面,但我想知道是否有任何可用的东西可以从命令行使用来“观察”更改并显示 git 文件的状态。如果我要修改一个文件,它会更改它的状态,而无需运行 git status
。
最佳答案
如评论中所述,如果您在 Linux 上,则可以简单地使用 watch
命令,如下所示:
watch git status
来自手册页:
watch runs command repeatedly, displaying its output and errors (the first screenfull). This allows you to watch the program output change over time. By default, the program is run every 2 seconds and runs until interrupted.
如果你在 Mac 上,默认情况下你不会有 watch
,但你可以通过 Homebrew 安装它,如下所示:
brew install watch
关于git - 是否有命令行工具可以实时显示 git 状态?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36431988/