~/.gitconfig: Set subcommand options

Viewed 32

I never want to run git diff or git show without the options --relative --src-prefix= --dst-prefix=. How can I make this permanent?

I know there are configuration options for certain things, such as

[diff]
    algorithm = histogram

… which does the same as --diff-algorithm=histogram, but is there a predictable way to translate option names to configuration names?

1 Answers

Not a generic way, but I found the corresponding config options:

[diff]
    relative = true
    noprefix = true

Found them by RTFM:

git help config | grep -C99 relative
Related