Based off of cowboy/dotfiles
When dotfiles is run for the first time, it does a few things:
- In Ubuntu, Git is installed if necessary via APT (it's already there in OSX).
- This repo is cloned into your user directory, under
~/.dotfiles. - Files in
/copyare copied into~/. (read more) - Files in
/linkare symlinked into~/. (read more) - You are prompted to choose scripts in
/initto be executed. The installer attempts to only select relevant scripts, based on the detected OS and the script filename. - Your chosen init scripts are executed (in alphanumeric order, hence the funky names). (read more)
On subsequent runs, step 1 is skipped, step 2 just updates the already-existing repo, and step 5 remembers what you selected the last time. The other steps are the same.
- The
/backupsdirectory gets created when necessary. Any files in~/that would have been overwritten by files in/copyor/linkget backed up there. - The
/bindirectory contains executable shell scripts (including the dotfiles script) and symlinks to executable shell scripts. This directory is added to the path. - The
/cachesdirectory contains cached files, used by some scripts or functions. - The
/confdirectory just exists. If a config file doesn't need to go in~/, reference it from the/confdirectory. - The
/sourcedirectory contains files that are sourced whenever a new shell is opened (in alphanumeric order, hence the funky names). - The
/testdirectory contains unit tests for especially complicated bash functions. - The
/vendordirectory contains third-party libraries.
Any file in the /copy subdirectory will be copied into ~/. Any file that needs to be modified with personal information (like copy/.gitconfig which contains an email address and private key) should be copied into ~/. Because the file you'll be editing is no longer in ~/.dotfiles, it's less likely to be accidentally committed into your public dotfiles repo.
Any file in the /link subdirectory gets symlinked into ~/ with ln -s. Edit one or the other, and you change the file in both places. Don't link files containing sensitive data, or you might accidentally commit that data! If you're linking a directory that might contain sensitive data (like ~/.ssh) add the sensitive files to your .gitignore file!
Scripts in the /init subdirectory will be executed. A whole bunch of things will be installed, but only if they aren't already.
- Read my gently-worded note
- Fork this repo
- Open a terminal/shell and do this (change
cowboyandmasteras appropriate):
export DOTFILES_GH_USER=kmosher
export DOTFILES_GH_BRANCH=master
bash -c "$(wget -qO- https://raw.github.com/$DOTFILES_GH_USER/dotfiles/$DOTFILES_GH_BRANCH/bin/dotfiles)" && source ~/.zshrcexport DOTFILES_GH_USER=kmosher
export DOTFILES_GH_BRANCH=master
bash -c "$(curl -fsSL https://raw.github.com/$DOTFILES_GH_USER/dotfiles/$DOTFILES_GH_BRANCH/bin/dotfiles)" && source ~/.zshrcSince you'll be using the dotfiles command on subsequent runs, you'll only have to set the DOTFILES_GH_USER variable for the initial install, but if you have a custom branch, you will need to export DOTFILES_GH_BRANCH for subsequent runs.
There's a lot of stuff that requires admin access via sudo, so be warned that you might need to enter your password here or there.
Copyright (c) 2014 "Cowboy" Ben Alman
Licensed under the MIT license.
http://benalman.com/about/license/