(˃ 𖥦 ˂) wowie ! don'tcha just miss them old school marquees? (˶˃ ᵕ ˂˶) .ᐟ.ᐟ

Tracking & Syncing my dotfiles!

Jun. 22, 2025

.dotfiles or… (.)²files?

- Using Git + Github, & tracking dotfiles with an alias.

# 1. Create a bare Git repo to track dotfiles
git init --bare ~/.dotfiles

# 2. Create an alias to simplify dotfiles management.
# Tells (/usr/bin/git) to link the git alias directory you just created to your real .config/
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'

# 3. Hide untracked files in ~/ from cluttering "git status"
dotfiles config status.showUntrackedFiles no

Setup & communicate with this repo via ssh, authenticating with a local private key.

# 4. Generate SSH key for GitHub auth (if you haven't got one already)
ssh-keygen -t ed25519 -C "[email protected]"
ssh-add ~/.ssh/id_ed25519

# Add the value of ~/.ssh/id_ed25519.pub as an entry in your Github --> Settings --> SSH & GPG Keys, via cat + copy-pasting, or however you'd like.

# 5. Force git on your machine to always push to github with SSH instead of HTTPS
git config --global url."[email protected]:".insteadOf "https://github.com/"

# 6. Set upstream branch as origin main & push via ssh!
dotfiles push --set-upstream origin main

then, upon changing my dotfiles, can push to github with:

- or… using a dotfiles manager, comme chezmoi.

… which is a tool that essentially creates a copy of your dotfiles folder outside of your /home directory (e.g. in ~/.local/share/chezmoi/private_dot_config/) to act as a place to stage, synchronise (with git) & manage changes to your local dotfiles.

I think of it as a remotely-connected playground for your dotfiles, to mess with them, pull them from remote repos etc., before applying the changes (via symlinks, copying, or templating) into your local home directory (e.g. ~/.config).

- To install:

- Editing your dotfiles & using chezmoi:

You can edit your dotfiles in multiple ways with chezmoi.

(RECOMMENDED) You can work and make changes within the locally-created chezmoi copy of your dotfiles, apply them locally, and push them to remote repo once done.

However, you also have the option of…

…making changes to your dotfiles normally (i.e. not within the chezmoi-managed copy of your dotfiles)

So, after you’re finished a particularly spicy ricing session, you can run:

chezmoi, importantly, allows you to do some of the following cool things: