Using git to manage dotfiles

After saw the article 使用 Git 管理自己的 dotfiles. I want to put my dotfiles into a git repository and write some deploy script to setup new Linux environment. Finally, the work is done during some modification.

I use three branch for my dotfiles:
  • public: Basic setting. It includes bashrc, vimrc, deploy scripts, ...etc. I push this branch to github public project for publish to blog. Any comment is welcome to improve my script & rcfile.
    .
  • private: Some personal information unsuited to publish, like github access key, netrc for git access and so on. I push this branch to bitbucket private repository for sync between my machines.
    This private branch always rebase public after any changes.
    .
  • local: The setting for which machine only. $PATH, specially software config, ...etc
    Like private, the local branch always rebase private.
    .


I also write a script to sync local and hosted repository as followed.
Again, Any comment is welcome.