Last Updated: February 25, 2016
·
2.333K
· csquirrel

Spread .gitconfig across multiple files for easy sharing

IMPORTANT: Include feature was introduced in Git 1.7.10+ version

Have your ever left your favourite git aliases set at home and missed them at work?

Simply spread git configuration across external files and share them via email, dropbox or github!

Follow three easy steps or scroll to the end for quick path

Step 1:
Extract bits of git configuration (~/.gitconfig) to external config files (i.e. ~/my-settings/git-aliases)

Step 2:
Include external config files in git configuration. Example:

[include]
    path = [ABSOLUTE_PATH]/my-settings/git-aliases

Step 3:
Share external config file. Example:

$> cp -Rv ~/my-settings/git-aliases ~/Dropbox

Quick path

Visit https://github.com/ciukes/CommonGitConf and use common setting shared by others.