Thanks to visit codestin.com
Credit goes to github.com

Skip to content

jesselang/dotfiles

Repository files navigation

What is $HOME/.current?

See the profiles README.

In 2025, I switched from a custom installation script that creates symlinks to using a bare repo approach. Migration involves removing the symlinks from $HOME before proceeding with the base repo install method.

# change to dotfiles repo with working files
cd path/to/dotfiles

# remove symlinks in $HOME that are sourced from dotfiles repo
find "$HOME" -maxdepth 1 -type l -exec sh -c '
  for f; do
    tgt=$(readlink -f "$f" 2>/dev/null || readlink "$f")
    case $tgt in
      "$PWD"/*) echo "$f" ;;   # symlink points inside $PWD
    esac
  done
' sh {} + | xargs rm

Bare repo setup

mkdir -p ~/.local/share/dotfiles

git clone --bare https://github.com/jesselang/dotfiles.git $HOME/.local/share/dotfiles/bare-repo

# first time install requires a checkout
git --git-dir=$HOME/.local/share/dotfiles/bare-repo --work-tree=$HOME checkout

# restore after dotfiles-uninstall on an existing checkout
git --git-dir=$HOME/.local/share/dotfiles/bare-repo --work-tree=$HOME restore .

Starting a new shell should provide a dotfiles alias to ease working with the repo and work tree:

# use sparse checkout to avoid checking out docs and unused files.
dotfiles sparse-checkout set --no-cone \
  '/*' \
  '!/*.md' \ # exclude root-level docs
           \ # (optional - exclude other paths that are emulator specific)
  '!/.local/share/dotfiles/emulators'

# disable parse checkout to update docs, etc.
dotfiles sparse-checkout disable

# update your config before commiting changes
dotfiles config user.email ...
dotfiles ls-files
dotfiles status
dotfiles diff
dotfiles commit

# uninstall dotfiles using alias (consider checking for uncommitted changes first)
dotfiles-uninstall
# without alias
dotfiles ls-files -z | xargs -0 rm

I don't want to forget about untracked files altogether, so rather than setting status.showUntrackedFiles to no, I've decided to start with a .gitignore file at the root to ignore paths I don't want tracked. This is likely to be a bit noisy to start, but it's a trade-off I'm willing to make.

About

My $HOME away from $HOME

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published