git clone <your-repo-url> ~/terminal-config
cd ~/terminal-config
./setup.shcd ~/terminal-config
./update-configs.sh
git add .
git commit -m "Update configs"
git pushcd ~/terminal-config
git pull
./setup.sh # Apply updates# For Zsh
source ~/.zshrc
# For Bash
source ~/.bashrc
# Or start new shell session
exec $SHELL| Config | System Location | Repo Location |
|---|---|---|
| Zsh Config | ~/.zshrc |
.zshrc |
| Zsh Profile | ~/.zprofile |
.zprofile |
| Bash Config | ~/.bashrc |
.bashrc |
| Bash Profile | ~/.bash_profile |
.bash_profile |
| Git Config | ~/.gitconfig |
.gitconfig |
| Tmux Config | ~/.tmux.conf |
.tmux.conf |
| Neovim Config | ~/.config/nvim/ |
nvim/ |
# Create timestamped backup
tar -czf ~/config-backup-$(date +%Y%m%d).tar.gz \
~/.zshrc ~/.bashrc ~/.tmux.conf ~/.gitconfig ~/.config/nvimtar -xzf ~/config-backup-YYYYMMDD.tar.gz -C ~/# From system to repo
cp ~/.zshrc ~/terminal-config/.zshrc
# From repo to system
cp ~/terminal-config/.zshrc ~/.zshrcchmod +x ~/terminal-config/setup.sh
chmod +x ~/terminal-config/update-configs.sh# Check file exists
ls -la ~/.zshrc
# Check for errors in config
zsh -n ~/.zshrc # for zsh
bash -n ~/.bashrc # for bash# Check health
nvim +checkhealth
# Clear cache
rm -rf ~/.local/share/nvim
rm -rf ~/.cache/nvim# Kill all tmux sessions
tmux kill-server
# Reload config in running session
tmux source-file ~/.tmux.conf
# or press: prefix + I (capital i)cd ~/terminal-config
git remote add origin <your-repo-url>
git branch -M main
git push -u origin main# Pull changes
git pull origin main
# Push changes
./update-configs.sh
git add .
git commit -m "Update: describe changes"
git push origin main# See modified files
git status
# See actual changes
git diff
# See specific file changes
git diff .zshrc- Never commit SSH private keys
- Review
.gitconfigbefore pushing (contains email) - Check shell configs for API keys or tokens
- Consider making repo private if it contains sensitive data
- Use environment variables for sensitive values
-
Alias for quick updates:
# Add to .zshrc or .bashrc alias config-update='cd ~/terminal-config && ./update-configs.sh' alias config-sync='cd ~/terminal-config && git pull && ./setup.sh'
-
Keep configs modular:
# In .zshrc, source separate files [ -f ~/.zsh_aliases ] && source ~/.zsh_aliases [ -f ~/.zsh_functions ] && source ~/.zsh_functions
-
Machine-specific settings:
# In .zshrc, use local config for machine-specific stuff [ -f ~/.zshrc.local ] && source ~/.zshrc.local # Add .zshrc.local to .gitignore
-
Test before committing:
# Always test configs in new shell zsh -c "source ~/.zshrc && echo 'Config OK'"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install git zsh tmux neovimsudo apt update
sudo apt install -y git zsh tmux neovimchsh -s $(which zsh)
# Log out and back inRepository: ~/terminal-config
Last Updated: January 2026