Dotfiles
Overview
- project-awesome dotfiles
- dotfiles.github.io
- "Your unofficial guide to doing dotfiles on GitHub"
- General-purpose dotfiles utilities
Dotfile managers
- chezmoi
- chezmoi vs. dotbot, rcm, vcsh, yadm, bare git
- Dotfile manager tool list, sorted by GitHub stars
git bare repository
- Simplest Way to Sync dotfiles and config Using Bare Git repo
- Manage Dotfiles With a Bare Git Repository
Initialize:
git init --bare $HOME/.dotfiles
echo "alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'" >> $HOME/.sh_aliases
. ./.sh_aliases
dotfiles config --local status.showUntrackedFiles no
dotfiles config --local user.name Varac
dotfiles config --local user.email varac@varac.net
dotfiles remote add origin git@0xacab.org:varac-projects/dotfiles.git
Usage:
dotfiles add ~/.config/sway
dotfiles status
dotfiles commit -m'Initial commit'
dotfiles push --set-upstream origin main
Pull to another device:
First, add an ssh key of the new device to 0xacab profile: keys Then:
git clone --bare git@0xacab.org:varac-projects/dotfiles.git $HOME/.dotfiles
echo "alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'" >> $HOME/.sh_aliases
dotfiles checkout
dotfiles config --local status.showUntrackedFiles no
Fetch all remote branches:
Somehow, dotfiles fetch
doesn't fetch any other remote branches, but this will
do:
dotfiles fetch origin '*:*'
Manage dotfiles with plain git repo
- Managing my dotfiles as a git repository Using a standard git repo, not a bare one
Manage dotfiles with Ansible
Other tools
Stale:
Example dotfile config repos
- sloria/dotfiles
- dotphiles A community driven framework of dotfiles
- andschwa/dotfiles
pre-commit
Solution:
alias dotfiles="GIT_DIR=/home/varac/.dotfiles/ GIT_WORK_TREE=/home/varac"
dotfiles pre-commit install
dotfiles pre-commit run --all