Configuration files for my development environment using a Git bare repo strategy.
git clone --bare git@github.com:socketwiz/dotfiles.git $HOME/.dotfiles
function git() {
# Check if you're inside a regular git repo
if git rev-parse --is-inside-work-tree > /dev/null 2>&1; then
command git "$@"
else
# Use the dotfiles repository when outside another git repo
/usr/bin/git --git-dir="$HOME/.dotfiles" --work-tree="$HOME" "$@"
fi
}
Then run:
git checkout
Secrets like API keys are stored in files excluded from Git:
~/.zshenv.local
Sourced via:
[[ -f ~/.zshenv.local ]] && source ~/.zshenv.local
Keep only what you need. Track only what you trust. Automate the rest.
—
Ricky Nelson