Can gitconfig options be set conditionally?

You can conditionally include another Git config file based on your Git directory or branch in Git 2.13 and later. Put your default configuration in file ~/.gitconfig as usual. At the end, conditionally include another configuration file: [user] email = john@personal.com name = John McGehee # All work Git repositories are in a subdirectory of …

Read more

Always use the pager for git diff

This is controlled by the -F (–quit-if-one-screen) option to less. Git uses the options FRSX for/of less by default, if none are specified by the $LESS or $GIT_PAGER environment variables. To change it, specify the core.pager option and set it to RSX: git config –global core.pager ‘less -+F’ Older versions of Git used to recommend …

Read more