This repository uses GNU Stow to manage dotfiles by creating symlinks from your home directory to the files in this repository.
The dotfiles are organized into packages:
bash/- Bash configuration files (.bashrc, .bashrc.bak, .inputrc)git/- Git configuration (.gitconfig)ssh/- SSH keys (.ssh/id_rsa, .ssh/id_rsa.pub)openai/- OpenAI configuration (.openai)
-
Install GNU Stow:
# Arch Linux sudo pacman -S stow # Ubuntu/Debian sudo apt install stow # macOS brew install stow # Fedora sudo dnf install stow
-
Verify installation:
stow --version
-
Clone this repository (or copy it to your new machine):
cd ~ git clone <repository-url> dotfiles # Or if you're copying manually: # mkdir -p ~/dotfiles && cp -r <path-to-dotfiles>/* ~/dotfiles/
-
Navigate to the dotfiles directory:
cd ~/dotfiles
-
Install all packages with stow:
stow bash git ssh openai
This will create symlinks in your home directory pointing to the files in this repository.
-
Set proper permissions for SSH keys (important for security):
chmod 700 ~/.ssh chmod 600 ~/.ssh/id_rsa chmod 644 ~/.ssh/id_rsa.pub
-
Verify the installation:
# Check that symlinks were created ls -la ~ | grep -E "\.bashrc|\.gitconfig|\.inputrc|\.openai" ls -la ~/.ssh | grep id_rsa # Verify symlinks point to the dotfiles directory readlink ~/.bashrc readlink ~/.gitconfig
If you only want to install specific packages:
cd ~/dotfiles
# Install only bash configs
stow bash
# Install only git config
stow git
# Install only SSH keys
stow ssh
# Install only OpenAI config
stow openai-
Edit files directly in this repository:
cd ~/dotfiles vim bash/.bashrc # or vim git/.gitconfig
-
Changes are immediately reflected in your home directory (via symlinks)
-
Commit and push changes:
git add . git commit -m "Update dotfiles" git push
To uninstall a package (removes symlinks but keeps files in repo):
cd ~/dotfiles
stow -D bash # Remove bash package
stow -D git # Remove git package
stow -D ssh # Remove SSH package
stow -D openai # Remove OpenAI packageIf you need to reinstall all packages:
cd ~/dotfiles
stow -D bash git ssh openai # Remove all
stow bash git ssh openai # Reinstall allIf you have existing dotfiles that aren't symlinks, stow will refuse to overwrite them. You have a few options:
-
Backup and remove existing files:
mv ~/.bashrc ~/.bashrc.old stow bash
-
Use stow's
--adoptflag (moves existing files into the package):stow --adopt bash
# Check if files are symlinks
file ~/.bashrc
file ~/.gitconfig
# Should show: "symbolic link to ..."cd ~/dotfiles
stow -n bash # Shows what would happen without making changes- SSH keys: Make sure to set proper permissions (600 for private key, 644 for public key)
- Stow behavior: Stow creates symlinks from
~/dotfiles/package/to~/. The directory structure in each package mirrors your home directory structure. - Backup: Always backup existing dotfiles before installing, especially on a new machine where you might have default configurations you want to keep.
# Install all
cd ~/dotfiles && stow bash git ssh openai
# Remove all
cd ~/dotfiles && stow -D bash git ssh openai
# Check what would happen (dry run)
cd ~/dotfiles && stow -n bash
# Reinstall a package
cd ~/dotfiles && stow -D bash && stow bash