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

Using dfm

0e1938953fb670f94a4e65b81a3cc58d?s=47 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/

0e1938953fb670f94a4e65b81a3cc58d?s=128

Nate Jones

September 29, 2011
Tweet

Transcript

  1. Using dfm managing your dotfiles with perl and git by

    Nate Jones LA.pm - 9/21/2011
  2. about me

  3. None
  4. github: justone twitter: @ndj http://endot.org

  5. </me>

  6. in the beginning

  7. .bashrc .vimrc

  8. None
  9. None
  10. None
  11. None
  12. version control!

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

    'initial' ssh secondbox svn checkout $MTSVN . svn add/commit/update
  14. None
  15. None
  16. None
  17. None
  18. brave new world

  19. Requirements accessible anywhere shareable quick to install/update easy to modify

  20. None
  21. None
  22. Prior work many shared dotfiles repos clone and symlink make,

    shell, ruby
  23. let's try it out

  24. Step 0 fork on github: https://github.com/justone/dotfiles set up your own

    master repo
  25. Installation $ git clone git@github.com: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
  26. 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 git@github.com:username/dotfiles.git 012325a..6c12a63 master -> master
  27. 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 git@github.com:username/dotfiles.git a0d469b..5a745c4 master -> master
  28. 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...
  29. special powers

  30. Run any git commands $ dfm status -s M .vimrc

    $ pushd ~/.dotfiles ~/.dotfiles ~ $ git status -s M .vimrc $ popd ~
  31. 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
  32. 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
  33. 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
  34. looking forward

  35. Low hanging fruit grow test suite more documentation 'dfm uninstall'

    'dfm umi' clean up dangling symlinks
  36. Ease of use starter repositories integrate bootstrap script ensure compatibility

    with zsh
  37. Advanced script to help with managing multiple branches automatic update

    checker git hooks ???
  38. more information

  39. Source and documentation http://github.com/justone/dotfiles http://github.com/justone/dotfiles/wiki http://github.com/justone/dfm_present

  40. Thanks http://git-scm.com/ http://www.perl.org/ https://github.com/schacon/showoff http://www.openclipart.org/

  41. questions?