On Sun, Dec 26, 2021, 2:18 PM Theodore Ts'o <tytso@mit.edu> wrote:
On Sun, Dec 26, 2021 at 12:43:37AM +0100, Steffen Nurpmeso wrote:
> I usually do "scp .* HOST:" whenever i get a HOST account, and
> forget about it thereafter.

I keep a private git repo on one of my machines, so when I get a HOST
account, I run a comand like this:

% git clone ssh://tytso@example.com/home/tytso/repos/dotfiles .

I have symlinks to all my files. I also have special hooks that I run per os and per host to pull in different configs when needed. Though in recent years I've not needed it much. I used to do a lot for work like this, but these days work envs are close to my home env, so there is little point.

I've been doing this since RCS days across 5 different SCMs... git makes oopses so rare that the paranoia below seems overkill. Though for other SCMs it would likely not be paranoid enough.

Warner 

% cd dotfiles
% make

This installs a bunch of symlinks from
dotfiles/{.bashrc,.profile,.muttrc}, etc. to $HOME/.

That way, I can run "git pull" to update my dotfiles on one particular
machine, and if I make local changes, I'll do a "git push" to send
them back to my dotfiles repo.

The Makefile I have in my top-level repo some folks might find
interesting:

.PHONY: all bin dotfiles

all: dotfiles

DIRS= .gnupg .mutt .config/gce-xfstests .config/gcloud/configurations bin em
#DBG= echo

dotfiles:
        for file in $(shell find $(CURDIR) -maxdepth 1 -type f -name ".*" \
            -not -name ".*~" -not -name ".gitignore" -print); do \
                f=$$(basename $$file); \
                if test -f $(HOME)/$$f -a ! -h $(HOME)/$$f ; then \
                        mkdir -p backup ; \
                        mv $(HOME)/$$f backup ; \
                fi ; \
                $(DBG) ln -sfn $$file $(HOME)/$$f; \
        done
        for dir in $(DIRS) ; do \
            $(DBG) mkdir -p $(HOME)/$$dir ; \
            for file in $$(find $$(pwd)/$$dir -maxdepth 1 -type f \
                -not -name "*~" -print); do \
                f=$$(basename $$file); \
                if test -f $(HOME)/$$dir/$$f -a ! -h $(HOME)/$$dir/$$f ; then \
                        mkdir -p backup/$$dir ; \
                        mv $(HOME)/$$dir/$$f backup/$$dir ; \
                fi ; \
                $(DBG) ln -sfn $$file $(HOME)/$$dir/$$f; \
            done; \
        done
        if test -d backup ; then find backup -type f -print ; fi

Cheers,

                                                - Ted
_______________________________________________
COFF mailing list
COFF@minnie.tuhs.org
https://minnie.tuhs.org/cgi-bin/mailman/listinfo/coff