For a years I was using a custom created scripts to keep my dot files updated. I had a local repository in bazaar and a script which check differences between home dot files and files stored in the repository. This solutions works fine for years, but now I want to do some changes…
The first one is moving my dot files to git (and probably pushed them to github), and the second one is to create a hook for git to update my dot files. I known that there are a lot of similar solutions, one more complex, other more easy, but this is mine
So, I created a post-commit hook script for git, which perform the modifications that I need. Now I just only do this steps:
1. Create a new git repo:
mkdir mydots_repo cd my_dots_repo && git init
2. Put the hook:
wget -O .git/hooks/post-commit http://2tu.us/2scm chmod 755 .git/hooks/post-commit
3. Copy old files:
cp ~/old/bzr_repo/* . git add *
4. Commit and recreate links:
git commit -a -m'initial import'
And it’s works