From 6abe7526e25f4b9b44440f034ec5cba1d1eb7798 Mon Sep 17 00:00:00 2001 From: Jonathan Agmon Date: Sat, 28 Mar 2026 12:02:50 +0300 Subject: [PATCH] md formatting for cmds --- linux/dotfiles.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/linux/dotfiles.md b/linux/dotfiles.md index 71c913d..f7a0cc3 100644 --- a/linux/dotfiles.md +++ b/linux/dotfiles.md @@ -1,32 +1,32 @@ # Dotfiles Management ## Create new bare repo ### 1. Initialize a bare repo in your home directory -git init --bare $HOME/.dotfiles +`git init --bare $HOME/.dotfiles` ### 2. Create an alias (add this to your .bashrc / .zshrc) -alias config='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME' +`alias config='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'` ### 3. Hide untracked files (so 'config status' isn't noisy) -config config --local status.showUntrackedFiles no +`config config --local status.showUntrackedFiles no` ### 4. Start tracking files -config add ~/.config/nvim/init.lua -config add ~/.config/alacritty/alacritty.toml -config commit -m "Add nvim and alacritty config" -config push +`config add ~/.config/nvim/init.lua` +`config add ~/.config/alacritty/alacritty.toml` +`config commit -m "Add nvim and alacritty config"` +`config push` ## Clone to a new machine ### Clone repo -git clone --bare https://github.com/you/dotfiles.git $HOME/.dotfiles +`git clone --bare https://github.com/you/dotfiles.git $HOME/.dotfiles` ### Set up the alias again, then checkout -alias config='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME' -config checkout +`alias config='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'` +`config checkout` ### If there are conflicts with existing files, back them up first -mkdir -p ~/.config-backup && \ -config checkout 2>&1 | grep "\s\+\." | awk '{print $1}' | \ -xargs -I{} mv {} ~/.config-backup/{} +`mkdir -p ~/.config-backup && \` +`config checkout 2>&1 | grep "\s\+\." | awk '{print $1}' | \` +`xargs -I{} mv {} ~/.config-backup/{}` ``` ## Key Principles