Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keeping dot files synched across machines?

Like most *nix people, I tend to play with my tools and get them configured just the way that I like them. This was all well and good until recently. As I do more and more work, I tend to log onto more and more machines, and have more and more stuff that's configured great on my home machine, but not necessarily on my work machine, or my web server, or any of my work servers...

How do you keep these config files updated? Do you just manually copy them over? Do you have them stored somewhere public?

like image 815
Steve Klabnik Avatar asked Oct 04 '08 02:10

Steve Klabnik


People also ask

How do I create a Dotfiles repository?

To create dotfiles, you use the touch command and pass the name(s) of the file(s) as the argument to the command. The filename(s) will have a preceding period. The first argument is the current path of the file – the tilde ( ~ ) stands for the home direcory.


4 Answers

I've had pretty good luck keeping my files under a revision control system. It's not for everyone, but most programmers should be able to appreciate the benefits. Read

Keeping Your Life in Subversion

for an excellent description, including how to handle non-dotfile configuration (like cron jobs via the svnfix script) on multiple machines.

like image 110
Blair Conrad Avatar answered Oct 01 '22 11:10

Blair Conrad


I also use subversion to manage my dotfiles. When I login to a box my confs are automagically updated for me. I also use github to store my confs publicly. I use git-svn to keep the two in sync.

Getting up and running on a new server is just a matter of running a few commands. The create_links script just creates the symlinks from the .dotfiles folder items into my $HOME, and also touches some files that don't need to be checked in.

$ cd

# checkout the files
$ svn co https://path/to/my/dotfiles/trunk .dotfiles

# remove any files that might be in the way
$ .dotfiles/create_links.sh unlink

# create the symlinks and other random tasks needed for setup
$ .dotfiles/create_links.sh
like image 29
claytron Avatar answered Oct 01 '22 09:10

claytron


It seems like everywhere I look these days I find a new thing that makes me say "Hey, that'd be a good thing to use DropBox for"

like image 7
Ryan Avatar answered Oct 01 '22 10:10

Ryan


Rsync is about your best solution. Examples can be found here:

http://troy.jdmz.net/rsync/index.html

like image 6
Bishop Avatar answered Oct 01 '22 09:10

Bishop