This is a bare Git repository containing my personal dotfiles for configuring and customizing my development environment across various systems. It includes configuration files for shell environments, text editors, version control systems, and other essential tools I use on a daily basis.
The goal of this repository is to keep my setup portable, easily accessible, and reproducible, allowing me to quickly set up new machines or restore my configuration across environments.
- Shell configuration (bashrc, zshrc, etc.)
- Vim/Neovim configuration (.vimrc, .config/nvim/*)
- Git configuration (.gitconfig, .gitignore_global)
- Tmux, Kitty, and other tool configurations
- System-wide configurations that can be personalized
To install these dotfiles on a new system or migrate to this setup:
git clone --bare git@github.com:Kyshman/dotfiles.git $HOME/.cfgecho ".cfg" >> $HOME/.gitignoreThis prevents recursive issues when .cfg tries to track itself.
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'Add this to your shell configuration file (~/.bashrc, ~/.zshrc, etc.) to persist it.
config config --local status.showUntrackedFiles noconfig checkoutThis pulls tracked files from the repository into your home directory.
Note: config checkout might fail if files with identical names already exist. Back up important files and delete or move conflicting ones, then run the command again until it completes successfully.
Use the config alias for all repository operations:
config status
config add .zshrc
config commit -m "Update zsh configuration"
config pushSome Git tools (like nlgc for commit message generation) expect a standard .git directory or file. Create a .git file in your home directory for compatibility:
echo "gitdir: $HOME/.cfg" > ~/.gitThis file acts as a pointer to your actual repository and enables compatibility with tools that use standard Git repository discovery.
For tools that don't automatically detect your repository configuration:
# From your home directory
cd ~
GIT_WORK_TREE=. nlgc # or other Git toolsYou can create an alias for convenience:
# Add to your shell configuration
alias nlgc-dotfiles='cd ~ && GIT_WORK_TREE=. nlgc'- Bare Repository Location:
~/.cfg/(contains all Git internals directly) - Work Tree:
~(your entire home directory) - Git Pointer:
~/.git(optional file pointing to~/.cfg)
This setup uses a bare repository to avoid having a .git directory in your home folder while still allowing version control of your entire configuration.
- Your dotfiles setup is complete! Treat your dotfile management system like any other Git project using the
configalias. - The repository is configured as
core.bare=true, meaning~/.cfgcontains the complete Git database without a working directory attached. - The work tree is explicitly set to
$HOMEwhen using theconfigalias. - The
.gitfile in your home directory is a standard Git feature for pointing to an external repository location.
- Error: "fatal: this operation must be run in a work tree": Ensure you're using the
configalias or have setGIT_WORK_TREEwhen running standardgitcommands. - Error: "Failed to find git repository root": Create the
.gitfile as described above or useGIT_WORK_TREE=.when running commands from~. - Files not showing up in status: Remember to set
status.showUntrackedFiles noto avoid cluttering status with unrelated files.