Ubuntu – Repercussions to sharing .bashrc across machines with Dropbox

bashdropbox

I work on a lot of different machines, all running Ubuntu (not always the same version). I have some really basic customizations to my prompt I would like to have available on all machines.

I currently use Dropbox and store all my other "dot files" there, such as my .vim/ .vimrc .gitconfig .ackrc. I then just link them to my home folder from my Dropbox folder. VoilĂ , all machines in sync.

I am unsure what the repercussions of doing something like this with my bashrc is. Can any one offer suggestions? Maybe an easy way to load a separate file in the bashrc?

Best Answer

I don't see any real repercussions, but I suppose it depends on what you have in there! If it's just quick aliases that work the same everywhere, and cosmetic stuff, I don't see any issues.

You could either just move your .bashrc to someplace in your Dropbox folder and then symlink it on each of the machines.

  mkdir -p ~/Dropbox/dotfiles
  mv ~/.bashrc ~/Dropbox/dotfiles/.bashrc
  ln -s ~/Dropbox/dotfiles/.bashrc ~/.bashrc

I actually have quite a few dotfiles in my home folder which are actually symlinks to shared folders in my Dropbox account.

Another option is that you could create a file inside your dropbox folder to be sourced by your .bashrc:

I.e., in your .bashrc, put:

source $HOME/Dropbox/dotfiles/bashrc-shared-settings

and then create a bashrc-shared-settings file which is the stuff you want used on all machines, and you can still keep separate .bashrc files.

(You can also abbreviate source as just . in bash.)

Related Question