# Dotfiles The following instructions will set up a bare Git repository in your home directory to track and manage your dotfiles without the need for symlinks or a separate tool. ## Quick start ```bash curl -L bit.ly/4vVSPw1 | sh ``` This will pull dotfiles into your home directory. Then run one of the init scripts in `~/.dotfiles.d/init`: ```bash bash ~/.dotfiles.d/init/init-shell.sh ``` Run `zsh` to initialize the configuration. You may also want to set `zsh` as default shell: ``` chsh -s $(which zsh) ``` **IMPORTANT**: Backup your critical dotfiles before initializing this repostitory. ```bash git init --bare $HOME/.dotfiles.git alias config='/usr/bin/git --git-dir=$HOME/.dotfiles.git --work-tree=$HOME' config config status.showUntrackedFiles no ``` ## Restore (sync) ```bash git clone --separate-git-dir=$HOME/.dotfiles.git http://git.nixlab.in/chodak166/dotfiles.git $HOME/dotfiles-tmp # cp ~/dotfiles-tmp/.gitmodules ~ # If you use Git submodules rm -r ~/dotfiles-tmp/ alias config='/usr/bin/git --git-dir=$HOME/.dotfiles.git/ --work-tree=$HOME' ``` ### Hard sync (replace existing files) ```bash config reset --hard origin/master ``` ## Usage ```bash config status config add .vimrc config commit -m "Add vimrc" config add .config/redshift.conf config commit -m "Add redshift config" config push ``` ## Initialization This is how it was created. No need to do this when using existing repository. ```bash git init --bare $HOME/.dotfiles.git alias config='/usr/bin/git --git-dir=$$HOME/.dotfiles.git --work-tree=$$HOME' config config status.showUntrackedFiles no