How do you effectively manage your .bashrc and .bash_profile configurations?

0
6
Asked By TechieTornado87 On

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

Answered By ShellSavant99 On

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.

Answered By GitGuru42 On

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.

Answered By NomadicNinja On

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.