I'm diving into Puppet and trying to establish standard aliases and configurations for my shell. However, I want to ensure I don't overwrite my existing .bashrc or .bash_profile files. I'm considering adding lines at the end of these files to source additional configuration files like ~/.bashrc-puppet and ~/.bashrc-local. This way, Puppet can manage the .bashrc-puppet, while all local modifications can be captured in .bashrc-local. Does this approach sound reasonable, or does anyone have other solutions?
3 Answers
I feel you on keeping things tidy! I keep my main configuration minimal and automatically include other scripts. I use a loop to source all scripts in my ~/.config/sh/ directory like this: for include_script in "$HOME"/.config/sh/*.sh; do . "$include_script"; done. I organize my config files into "packages" that I manage with GNU stow, which keeps everything nice and organized.
Check out some "dotfiles" repositories on GitHub. I handle my configuration similarly to what you suggested: I have a Git-tracked repo where my .*rc files are symlinked in, and I simply source my bashrc. It’s a straightforward and effective method, plus it scales well across different hosts and environments.
Using a bare repository for your dotfiles can be super simple and efficient. I have my home directory set up as a Git project and track all my dotfiles, including .bashrc and .bash_profile, after adding them to the repo. It's like having your own version control for config files!

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically