My personal dotfiles using the bare git repository method.
- Starship prompt with git status indicators
- Cross-platform bash configuration (macOS + Linux)
- Clean separation - only explicitly tracked files are managed
- No symlinks - files live in their natural locations
- Simple management - use
configcommand instead ofgit
curl -Lks https://raw.githubusercontent.com/alecf/shellconfig/main/install.sh | bashThen restart your shell or run source ~/.bashrc.
# Clone the bare repository
git clone --bare https://github.com/alecf/shellconfig.git $HOME/.cfg
# Define the config alias
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
# Checkout dotfiles
config checkout
# Hide untracked files
config config --local status.showUntrackedFiles no
# Reload shell
source ~/.bashrcUse the config command exactly like git, but for dotfiles:
# Check status
config status
# Add a new dotfile
config add .vimrc
# Commit changes
config commit -m "Update vimrc"
# Push to GitHub
config push
# Pull latest changes
config pull.bashrc- Main bash configuration.bash_profile- macOS login shell setup.profile- Linux login shell setup.gitconfig- Git configuration with aliases.config/starship.toml- Starship prompt configurationbin/- Personal scripts
- Starship prompt with simple fallback
- Cross-platform ls/grep aliases (works on macOS and Linux)
- Version managers: pyenv, rbenv, nvm, volta
- Tool support: docker-compose, aws-vault, pre-commit
- Git aliases: gbage (branch age), cleanup-main, cleanup-merged
- Git
- Bash 4+ (macOS ships with 3.2, use Homebrew to upgrade)
- Starship for the fancy prompt (optional)
To track a new dotfile:
config add -f ~/.newfile
config commit -m "Add newfile"
config pushThe -f flag is needed because .gitignore ignores everything by default.
The .bashrc detects the OS and adjusts automatically:
- macOS: Uses
ls -Gfor colors, loads Homebrew - Linux: Uses
ls --color=auto, checks for linuxbrew
Never commit secrets! For machine-specific credentials:
- Create
~/.bash_localfor environment variables - Source it from
.bashrc(add[ -f ~/.bash_local ] && . ~/.bash_local) - Add
!.bash_localto.gitignore(already done)
Q: config command not found
A: Reload your shell with source ~/.bashrc or start a new shell.
Q: Files won't checkout due to conflicts
A: The install script backs up existing files to ~/.dotfiles-backup/.
Q: How do I see all tracked files?
A: Run config ls-files
Q: Starship not showing git status
A: Make sure Starship is installed: brew install starship (macOS) or check starship.rs
The bare repository method is the modern standard for dotfiles because:
- No symlinks - files stay where they belong
- Safe by default - won't accidentally commit everything in
~/ - Works everywhere - just git, no special tools needed
- Clean
git statusin your home directory still works for other repos
Do whatever you want with this.