Skip to content

jpabbuehl/dotfiles

Repository files navigation

Dotfiles Management 🗂️

Manage and sync your dotfiles (configuration files) using a Git bare repository. This approach allows easy tracking of dotfiles and seamless application to any new system.

Initial Setup 🛠️

Follow these steps to initialize your dotfiles repository:

  1. Initialize a Bare Git Repository:
git init --bare $HOME/.cfg
  1. Create an Alias for Dotfile Management:
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
  1. Configure Git to Ignore Untracked Files:
config config --local status.showUntrackedFiles no
  1. Persist the Alias in Your .bashrc:
echo "alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'" >> $HOME/.bashrc
  1. Push Your Changes to a Remote Repository:
git push

Installing on a New System 🌟

Easily apply your dotfiles to a new system with these steps:

  1. Create the Configuration Alias:
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
  1. Clone Your Dotfiles Repository:
git clone --bare git@github.com:jpabbuehl/dotfiles.git $HOME/.cfg
  1. Prevent Git from Tracking Your Home Directory:
echo ".cfg" >> .gitignore
  1. Backup Existing Dotfiles: To avoid conflicts, backup any existing dotfiles:
mkdir -p .config-backup &&
config checkout 2>&1 | egrep "\s+." | awk {'print $1'} |
xargs -I{} mv {} .config-backup/{}
  1. Checkout Your Dotfiles:
config checkout
  1. Update Local Git Configuration:
config config --local status.showUntrackedFiles no

Notes 📝

  • The config command can be used similarly to git for any dotfiles-related operations.
  • Customize the config alias as per your preference.

Happy dotfile managing! 😄

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published