This repository stores dotfiles using jj-vcs (Jujutsu) as the version control tool. The working tree is the home directory (~) itself, so no symlinks are needed.
- Install
git. - Install
jj.
Create ~/.gitignore before initializing so jj doesn't try to snapshot the entire home directory:
echo '*' > ~/.gitignoreInitialize a bare jj repo (git backend in ~/.dotfiles, workspace in ~). The --config flag prevents it from trying to snapshot all of ~ during init:
git init --bare "$HOME/.dotfiles"
jj git init --git-repo="$HOME/.dotfiles" "$HOME" --config snapshot.auto-track='none()'
jj config set --repo snapshot.auto-track 'none()'Add the remote, fetch, and check out main:
jj git remote add origin [email protected]:datwaft/dotfiles.git
jj git fetch
jj bookmark track main --remote origin
jj new main
jj restore .This setup means you can use jj anywhere in your home directory and it will work.
If you are inside another repository jj will use that repository instead, which is the expected behaviour as we don't want to accidentally add files inside another repository to this repository.
As we are ignoring all files by default, we need to explicitly track files using jj file track --include-ignored. This repository has an abbreviation for adding --include-ignored automatically.
jjuses a bare git repo in~/.dotfilesso any tool that is not configured to work withjjwill not detect a git repository in the home directory. This prevents performance implications.- You need to use
jj file track --include-ignoredto track files as the files are not being tracked automatically. This is a protection measure to prevent accidentally tracking files.