简体   繁体   中英

git highlighting of commit message

Is it possible to make git commands highlight a commit message in the terminal?

For example:

$git stash

Saved working directory and index state WIP on master: 9d657ff Sort events

HEAD is now at 9d657ff Sort events

Otherwise it is hard to catch them in the abundant output of git.

Adding --color works for several git commands... but not for that specific one ( git stash ), and they highlight the commit hash, not the commit message.

git stash list is supposed to take the same options as git log (which includes --color ), but I had to specify some format (eg --oneline ) to get it to work:

git stash list --oneline --color

Also, git has a config option to use color in all commands by default ( color.ui , in git help config )... but, like the above, it works for some commands, but not that one.

Finally, git log enables you to specify precisely what colors you want in the formatting, and since many commands use git log and accept options for it, you could highlight the commit message in that way, for those commands (and make aliases for them).

FWIW I agree it would be a good feature.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM