Skip to content

Instantly share code, notes, and snippets.



Created Jul 4, 2012
What would you like to do?
Create links for all files stored in git to your local dot files. You can now keep backups on git with ease.
mkdir -p $HOME/git/dotfiles/vim;
files=("bash_profile bashrc inputrc screenrc vim vimrc zshrc");
for file in $files; do
if [[ -h $HOME/.$file ]]; then
unlink $HOME/"."$file;
elif [[ -e $HOME/.$file ]]; then
mv $HOME/"."$file $HOME/"."$file"."$(date +%m"."%d"."%Y)
ln -s $HOME/git/dotfiles/$file $HOME/"."$file;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.