Skip to content

davidarthurthomas/dots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dotfiles

My personal dotfiles, managed using a bare Git repository.

How It Works

This setup uses a bare Git repository stored in ~/.cfg with the working tree set to $HOME. This allows tracking dotfiles directly in the home directory without symlinking or additional tools.

The key is a config alias that wraps git commands:

alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'

This lets you run git commands like config status, config add, config commit, etc. to manage your dotfiles.

What's Tracked

  • .zshrc - Zsh configuration (aliases, prompt, plugins, etc.)
  • .config/ - Application configurations
  • Library/ - macOS application settings

Setting Up on a New Machine

1. Clone the Repository

git clone --bare git@github.com-davidarthurthomas:davidarthurthomas/dots.git $HOME/.cfg

2. Define the Alias

alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'

3. Checkout the Files

config checkout

If you get errors about existing files that would be overwritten:

# Back up conflicting files
mkdir -p .config-backup
config checkout 2>&1 | grep -E "^\s+\." | awk {'print $1'} | xargs -I{} mv {} .config-backup/{}

# Then retry checkout
config checkout

4. Configure the Repository

Hide untracked files (so config status only shows tracked files):

config config --local status.showUntrackedFiles no

5. Add the Alias Permanently

Add this line to your ~/.zshrc or ~/.bashrc:

alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'

Usage

Once set up, use the config alias just like git:

# Check status
config status

# Add a file
config add .vimrc

# Commit changes
config commit -m "Add vimrc"

# Push to remote
config push

# Pull updates
config pull

Adding New Dotfiles

config add ~/.some-config-file
config commit -m "Add some-config-file"
config push

References

About

My dotfiles

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages