I would like to watch the output of the local git status
and git log
commands so that anytime a change is made to code in my local git repository the git status and git log commands are re-run and the new output is shown. Any ideas on how I might accomplish this?
Asked
Active
Viewed 393 times
1

Espresso
- 740
- 13
- 32
1 Answers
2
You could use watch
command. For example watch -n 5 git log
will rerun git log
every five seconds.

Jorengarenar
- 2,705
- 5
- 23
- 60
-
2You may want to run `git log -10` to view only the last commits, instead of the complete history – LeGEC Jul 08 '20 at 20:47
-
I would also throw `--oneline` to have just the main commit messages – Jorengarenar Jul 08 '20 at 20:56
-
1To preserve the color: `watch -c git -c color.ui=always log` – M Imam Pratama May 11 '22 at 07:01
-
[Use `git log --decorate` to preserve the ref names](https://stackoverflow.com/a/72196740/9157799) `(HEAD -> master, origin/master, origin/HEAD)`. – M Imam Pratama May 11 '22 at 07:11