Instructions for the dotfile repository on https://github.com/weibeld/dotfiles.
The dotfiles in this repository are installed using a bare Git repository. This method does not use symlinks (like most other dotfile repositories).
After the installation, all the dotfiles will be physically present in your home folder, yet, you will still have them under full version control.
curl -Lks http://bit.ly/get-my-dotfiles | bash
The URL http://bit.ly/get-my-dotfiles is simply a shortened link to the dotfiles-install.sh file in this Gist, and the above command downloads this file and executes it in a sub-shell.
In particular, the dotfiles-install.sh
file does the following:
- Clone the dotfile repository to a bare Git repository into
~/.dotfiles
- Move your existing dotfiles to
~/.dotfiles.backup
- Check out all the dotfiles (and dot-directories) to your home directory
If you don't need your old dotfiles anymore, you can safely delete the created ~/.dotfiles.backup
directory.
Now all the dotfiles from the repository are installed in your home directory. However, as mentioned, you still have them under full version control via the bare Git repository in ~/.dotfiles
.
To interact with the bare Git repository, you need the following alias:
alias dotfiles='git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
Note: the .bashrc
file in the dotfile repository already contains this alias definition, so you're fine to go.
With the dotfiles
alias, you can now manage the dotfiles via the bare Git repository, just as you would with the git
command:
Edited your dotfiles? No problem, commit and push the changes:
dotfiles add ~/.vimrc
dotfiles commit -m "Edit .vimrc"
dotfiles push
Pushed changes to the remote repository from another machine? Easy, just pull down the new version:
dotfiles pull
Want to know what's going on? Sure:
dotfiles status
The dotfile repository supports submodules (Git repositories within another Git repository).
The case for submodules occurs typically with Vim plugins, if you install them with pathogen.vim by cloning the respective Git repository into a directory under ~/.vim/bundle
.
Here are some common tasks when using submodules:
-
Add a Vim plugin as a submodule to the repository:
dotfiles submodule add https://github.com/tpope/vim-surround .vim/bundle/vim-surround dotfiles commit dotfiles push # Download files of submodule on local machine dotfiles submodule init
-
Pull changes that inlude a newly added submodule on another machine:
dotfiles pull dotfiles submodule init dotfiles submodule update
-
List all submodules in the repository (including the commit that is used for each submodule):
dotfiles submodule status
-
Update the submodules in the repository to the newest commits:
dotfiles submodule update --remote dotfiles add <changed_files> dotfiles commit
The used installation method using a bare Git repository is described here: