I've moved to using GNU Stow for my personal dotfiles maintenance instead of a bare repository.
Caution
Backup your files!
Always cd ~/dotfiles
dir before any stow command
Note
setup option:
This would move your dotfiles to ~/dotfiles
It would show preview of changes before applying them
- For .config files:
~/.config/nvim
to~/dotfiles/dot-config/nvim
- For dot files:
~/.vim
to~/dotfiles/dot-vim
- For dot files:
~/.zshrc
to~/dotfiles/dot-zshrc
Note
deploy option:
This would deploy your dotfiles to your home directory It would show preview of changes before applying them
- This using stow to deploy your files.
- Command used for preview:
stow -n -v --dotfiles --target="$HOME" .
- Command used for deploy:
stow -v --dotfiles --target="$HOME" .
# Make the setup script executable
chmod +x setup.sh
# Run the setup script
./setup.sh --setup
# This would deploy your dotfiles to your home directory
./setup.sh --deploy
# This would initialize git repository in your dotfiles directory
./setup.sh --init-git
- Create folder ~/dotfiles
- initialize git repo
echo "# dotfiles" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/Cyber-Syntax/dotfiles.git
git push -u origin main
- Make folder for ~/.config
mkdir -p ~/dotfiles/dot-config/
- Copy your configs
cp -r ~/.config/nvim ~/dotfiles/dot-config/
- test stow dry without change anything to make sure about changes correct
cd ~/dotfiles &
stow -n -v --dotfiles --target="$HOME" .
- If everythings work perfect, stow your files
cd ~/dotfiles &
stow --dotfiles --target="$HOME" .
- Alias for stow
~/dotfiles/.stowrc
:
--dotfiles
--target="$HOME"
--ignore=.stowrc
- stow files to symlink
cd ~/dotfiles &
stow .