Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Using dfm

Nate Jones
September 29, 2011

Using dfm

A presentation given to LosAngeles.pm about 'dfm', a script to manage your dotfiles.

https://github.com/justone/dotfiles
http://endot.org/2010/10/16/dfm-a-utility-to-manage-dotfiles/

Nate Jones

September 29, 2011
Tweet

Other Decks in Programming

Transcript

  1. Ready, set, go! ssh firstbox svn import . $MTSVN -m

    'initial' ssh secondbox svn checkout $MTSVN . svn add/commit/update
  2. Installation $ git clone [email protected]:username/dotfiles.git .dotfiles Cloning into .dotfiles... remote:

    Counting objects: 1685, done. remote: Compressing objects: 100% (830/830), done. remote: Total 1685 (delta 714), reused 1632 (delta 689) Receiving objects: 100% (1685/1685), 1.19 MiB | 438 KiB/s, done. Resolving deltas: 100% (714/714), done. $ ./.dotfiles/.bin/dfm INFO: Installing dotfiles... INFO: Symlinking .bashrc.load (.dotfiles/.bashrc.load). INFO: Symlinking bin (.dotfiles/bin). INFO: Appending loader to .bashrc
  3. Adding a file $ vi .vimrc $ mv .vimrc .dotfiles

    $ dfm install INFO: Installing dotfiles... INFO: Symlinking .vimrc (.dotfiles/.vimrc). $ dfm add .vimrc $ dfm status -s A .vimrc $ dfm commit -m 'added vimrc' [master 6c12a63] adding vimrc 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 .vimrc $ dfm push origin master Counting objects: 4, done. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 265 bytes, done. Total 3 (delta 1), reused 0 (delta 0) To [email protected]:username/dotfiles.git 012325a..6c12a63 master -> master
  4. Changing a file $ vi .vimrc $ dfm status -s

    M .vimrc $ dfm commit -am 'updated vimrc' [master be47490] updated 1 files changed, 1 insertions(+), 0 deletions(-) $ dfm push origin master Counting objects: 4, done. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 301 bytes, done. Total 3 (delta 1), reused 0 (delta 0) To [email protected]:username/dotfiles.git a0d469b..5a745c4 master -> master
  5. Getting latest dotfiles $ dfm updates remote: Counting objects: 5,

    done. remote: Compressing objects: 100% (2/2), done. remote: Total 3 (delta 1), reused 3 (delta 1) Unpacking objects: 100% (3/3), done. From github.com:username/dotfiles 5a745c4..012325a master -> origin/master 012325a: updated vimrc $ dfm mi INFO: using merge to bring in changes Updating 5a745c4..012325a Fast-forward .vimrc | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) INFO: re-installing dotfiles INFO: Installing dotfiles...
  6. Run any git commands $ dfm status -s M .vimrc

    $ pushd ~/.dotfiles ~/.dotfiles ~ $ git status -s M .vimrc $ popd ~
  7. Backups $ cat .vimrc syntax on $ dfm install INFO:

    Installing dotfiles... INFO: Backing up .vimrc. INFO: Symlinking .vimrc (.dotfiles/.vimrc). $ cat .vimrc set nocompatible set bg=dark set ts=4 sw=4 set incsearch $ cat .backup/.vimrc syntax on
  8. Skipping files $ ls -l .dotfiles/README.md -rw-rw-r-- .dotfiles/README.md $ cat

    .dotfiles/.dfminstall README.md skip $ dfm install INFO: Installing dotfiles... $ ls README.md ls: cannot access README.md: No such file or directory
  9. Recursion $ ls -l .dotfiles/.ssh/ -rw-r--r-- config $ cat .dotfiles/.dfminstall

    .ssh $ dfm install INFO: Installing dotfiles... INFO: Symlinking config (../.dotfiles/.ssh/config). $ ls -ld .ssh/ drwx------ .ssh/ $ ls -l .ssh lrwxrwxrwx .ssh/config -> ../.dotfiles/.ssh/config -rw-r--r-- .ssh/known_hosts