The following describes a simple way to manage you profile configuration files using GitHub.
Open a terminal and switch to your home directory
cd ~
Create a configuration directory
mkdir .config.git
Add the following alias to your current session and your .bash_profile
alias config='git --git-dir=$HOME/.config.git/ --work-tree=$HOME'
echo "alias config='git --git-dir=$HOME/.config.git/ --work-tree=$HOME'" >> .bash_profile
Add your .bash_profile to the configuration repository
config add .bash_profile
Commit the changes
config commit -m 'Initial commit'
Change the origin to GitHub
config remote add origin git@github.com:GITHUB_USERNAME/config.git
Push the changes
config push origin master
If you get an error when running config pull to the effect of You asked me to pull without... run the follow:
echo -e '[branch "master"]\n remote = origin\n merge = refs/heads/master' >> ~/.config.git/config
Switch to your home directory
cd ~
Backup your local configuration files, example:
mv .bash_profile .bash_profile.bk
Clone your configuration repository
git clone git@github.com:GITHUB_USERNAME/config.git config.git
Move the git metadata to ~/.config.git
mv config.git/.git .config.git
Enable dotglob
shopt -s dotglob
Move your configuration files to your home directory
mv -i config.git/* .
Delete the config.git directory
rmdir config.git
Logout and log back in
config pull - get latest configuration changesconfig add FILENAME - add a configuration fileconfig commit -a - save all configuration changesconfig push - push configuration changes to GitHubconfig GIT_OPTIONYou can see my configuration repository at http://github.com/silas/config.
Source: Manage your $HOME with git by Robert Escriva
Licensing information is available on the about page, for additional questions or comments feel free to contact me.