Modular, secure, and portable Bash configuration system with environment-specific customisations for home and work setups.
This repo is designed to be:
- 🧩 Modular – clean separation of shared and machine-specific logic
- 🛡️ Secure – sensitive details are kept in a separate
secrets/file (git-ignored) - 🧼 Maintainable – easily extensible as your setup evolves
- 🌍 Portable – supports multiple environments via specialisations
bash-config/
├── bashrc_core # Main orchestrator script (symlinked as ~/.bashrc_core)
├── bash_aliases # Shared aliases across all systems
├── bash_prompt # Prompt appearance and toggles
├── bash_exports # Shared environment settings
├── bash_tools # Utility shell functions (e.g. mae, Git config setup)
├── install.sh # Setup helper script
├── configs/
│ ├── gitconfig_base # Shared Git aliases and settings
│ ├── gitconfig_diamond # Diamond-specific Git config template
│ └── gitconfig_frostpaw # Frostpaw-specific Git config template
├── secrets/
│ ├── bash_secrets.sh # Local-only, untracked file for credentials and paths
│ ├── gitconfig_user_public # Git user config for public account (untracked)
│ └── gitconfig_user_private # Git user config for private account (untracked)
└── specialisations/
├── bashrc_frostpaw # Home setup (Arch Linux, neofetch, yay updates)
└── bashrc_diamond # Work setup (modules, SSH keys, hostname mapping)
git clone git@github.com:dimitrivlachos/bash-config.git ~/Documents/bash-config
cd ~/Documents/bash-config./install.shThis will:
- Ask you which specialisation to enable (frostpaw or diamond)
- Link bashrc_core to ~/.bashrc_core
- Append this to your ~/.bashrc:
export BASH_SPECIALISATION="frostpaw" source ~/.bashrc_core
- Create a placeholder
secrets/bash_secrets.shif it doesn't exist
git-setupThis will generate your ~/.gitconfig with all aliases and settings. See Git Configuration below for details.
The following specialisation values are supported:
| Name | Description |
|---|---|
| frostpaw | Home setup (Arch Linux, neofetch, yay updates) |
| diamond | Work setup (modules, SSH keys, hostname mapping) |
Set the desired specialisation in ~/.bashrc:
export BASH_SPECIALISATION="{specialisation}"This variable is read by bashrc_core to load the correct specialisation file.
Sensitive values are stored in:
bash-config/secrets/bash_secrets.shThis file is ignored by Git and sourced by bashrc_core. It contains environment variables for:
- Usernames
- Key paths
This allows a file to dynamically set the correct values such as:
/dls/science/users/$USER/...Git user details are also stored in secrets to keep your email addresses private:
For Frostpaw (dual GitHub accounts):
Create these files in secrets/:
# secrets/gitconfig_user_public (for github.com-d)
[user]
name = Your Name
email = your.work@email.com# secrets/gitconfig_user_private (for github.com-s)
[user]
name = Your Name
email = your.personal@email.comFor Diamond:
Only secrets/gitconfig_user_public is needed with your work credentials.
This bash-config includes a comprehensive Git configuration system with:
- 40+ useful aliases for common Git operations
- Sensible defaults for core, pull, push, and merge behavior
- Automatic user switching based on remote URL (Frostpaw only)
- Cross-platform line ending handling
Run the setup command to generate your ~/.gitconfig:
git-setupThis reads the template files in configs/ and generates ~/.gitconfig with absolute paths resolved for your system.
Base Configuration (configs/gitconfig_base)
Contains all shared aliases and settings used across all machines:
- Status, commit, branch, and log shortcuts
- Editor, pager, and color settings
- Merge and diff configurations
Specialisation Templates (configs/gitconfig_{diamond,frostpaw})
- Diamond: Simple setup that includes base config + public user credentials
- Frostpaw: Advanced setup with conditional includes based on Git remote URLs
- Repos cloned with
git@github.com-d:...use public account - Repos cloned with
git@github.com-s:...use private account
- Repos cloned with
User Credentials (secrets/gitconfig_user_{public,private})
Contain your name and email, kept in the gitignored secrets/ directory.
View all available aliases:
git aliasesSome useful examples:
# Status shortcuts
git s # Short status with branch info
git st # Full status
# Commit shortcuts
git cm "message" # Commit with message
git ca # Amend last commit
git can # Amend without changing message
# Branch management
git b # List branches
git ba # List all branches (including remote)
git bd branch-name # Delete branch (safe)
# Beautiful logs
git l # Compact log with graph
git lg # Colorful detailed log with graph
# Quick operations
git unstage file # Unstage a file
git undo # Undo last commit (keeps changes)
git discard file # Discard changes to fileCore Settings:
editor = vim- Uses Vim for commit messagesautocrlf = input- Handles cross-platform line endings (converts CRLF→LF on commit)pager = less -FRX- Improved pager settings (quits if one screen, shows colors, doesn't clear)
Behavior:
push.autoSetupRemote = true- No need for-uflag when pushing new branchespull.rebase = false- Uses merge strategy (creates merge commits)init.defaultBranch = main- New repos usemaininstead ofmaster
Better Diffs & Merges:
merge.conflictstyle = diff3- Shows 3-way conflict markers (yours | base | theirs)diff.colorMoved = default- Highlights moved code blocks differently
If you modify the config templates in configs/, regenerate your ~/.gitconfig:
git-setupThe system will backup your existing config before generating a new one.
These commands let you customise your prompt in real-time:
| Command | Description |
|---|---|
tgit |
Toggle Git branch display |
tdir |
Toggle between long \W and short \w directory display |
tem |
Toggle emoji usage in prompt |
ph |
Show all available prompt helpers |
rp |
Reset prompt to default |
These are available globally on all systems.