Using GNU Stow to manage your dotfiles
brandon.invergo.net
brandon.invergo.net
I totally disagree. I love having much of my home directory in git. I have a .gitiignore for the stuff I don't want in there, but the rest. Ahhhhh, so nice to be able to clone somewhere else and use.
status --short --branch --untracked=no
[1] https://github.com/cespare/dotfiles/blob/master/.gitconfig#L... /*
!/.gitignore
!/.gitmodules
!/.gitconfig
!/.zshrc
!/.zshenv
!/.zsh
!/.tmux.conf
!/.vimrc
!/.vim /*
!/.emacs
!/.emacs.d/
/.emacs.d/*
!/.emacs.d/themes/
!/.emacs.d/functions/
You can check my .gitignore here [0].Like, say you thought ~/src/xulrunner was a git repo, but it was actually managed with hg or maybe was extracted from a tarball. Whereas normally executing some git command would complain that this is not a repo, if your ~ is a git repo then git will happily execute whatever you told it to on your dotfiles repo.
mv .git dot_git
git --git-dir="dot_git" add ...
Thats also a nice trick if you need a git repos in a git repos, e.g. for integration test for libraries interacting with git. $ ls -A
.gitconfig@ .hushlogin .local/ .notes/ .ssh/ www@ .zshrc@
All other dotfiles are configured to be picked up from somewhere inside .local either using environment variables or aliases.[1] On the other hand, the laptop -- where I run X and gnome -- is a disaster.
https://bitbucket.org/davidn/dotstuff
I settled on copying rather than symlinking, which has the benefit that the source files can be passed through a simple preprocessor to do some customization for different systems. Also you can get a diff between your current files and the state that you just synced.
ghar, a project I wrote, is a single standalone python file: https://github.com/philips/ghar
This lets me perform any necessary initialization (e.g. cloning submodules) via `make` and installing the actual symlinks into $HOME via `make install`.
For example, I would like to construct my bashrc using something like run-parts. This system would take bash/★.bashrc, this-machine/local-env.bashrc, and special-app/proxy-env.bashrc and compile them into a single ~/.bashrc. I would also like to be able to build a ~/.nanorc that only includes features supported by the installed version of nano. Some dotfiles include both public and private data -- I'd like to publish my git aliases, but not my GitHub authentication token.
So I basically want a dotfile manager that's a combination of PHP, run-parts, and stow: dotfiles constructed through in-line Perl code (in my nanorc or ssh_config) with assembly of multiple pieces (in my bashrc or gitconfig) and installed into the right place in my home directory.
As far as I can tell there's nothing out there that can do this. (Although I also insist it be written in something classic that I can find anywhere, like Python 2.4 or Perl or something like that. So I didn't look at any of the many dotfile managers written in Ruby or Node.)
<? @NANO_VER = `nano -V` =~ m/version (\d+)\.(\d+)/ ?>
set const
set cut
<? if ( $NANO_VER[0] > 2 || $NANO_VER[1] >= 1 ) { # Assume nano 1.x isn't still an issue
?>
bind M-f nextword main
bind M-b prevword main
<? }
print "include \"$_\"\n" foreach </usr/share/nano/*.nanorc>;
# Maybe I'll have to write this myself....
?>My dotstuff script can do most of that, with a little bit of work. With the current features, you'd put all your bashrc content into a single ~/dotstuff/bashrc file, marked off with preprocessor directives that turned on and off certain sections depending on the content of the "environment" (a simple key-value file).
Adding the ability to query the version of installed software would be easy to add. Adding the ability to concatenate multiple files would be fairly easy too. Although I think an "include" directive might make more sense than run-parts style, since many dotfiles have hierarchical structure.
It's written in 2.4-compatible Python and I'm happy to accept contributions.
for i in ~/.bash.d/* ~/.local.bash.d/; do
test -e $i && source $i
done
Which functionally does what you want, loading everything from a directory. Though it doesn't do version-testing, or actual concatenation.http://episodes.gitminutes.com/2013/06/gitminutes-13-richard...
You can change this behaviour using the --target and --dir options, where setting --dir will set the target dir to the parent of what you set for --dir.
I don't think it's possible to configure a target in the package itself, as far as I can see from reading the man page.
RCS, in short, is that horrible feet-killing pair of boots that made you think you hated <insert sport here>, when in fact it was just frustration with sub-par equipment.
[1] If you need to learn git, check out Scott Chacon's excellent Pro Git, available for free online at: http://www.git-scm.com/book
That said, using tools mentioned in this thread (esp. vcsh[1] and mr[2]) it's possible to have one's cake and eat it too w.r.t. using git for homedir version control without the worries of accidentally running VCS commands on your homedir. They also allow some real benefits, like the ability to use and deploy subsets of your rcfiles. For example, you could easily create profiles like: "server-side minimal core", "main personal system", "work box with employer-specific stuff".
On Solaris hosts, including locked-down "production", I use SCCS to version my dot-files because it's available by default. For development I use SVN (old too by today's standards).
I don't advocate using these old tools over modern alternatives; however I find their simplicity in the above cases to be beneficial.
Ever heard of shell scripts? This is what I use: https://code.google.com/p/aram-dotfiles/source/browse/make.u...
eg.
alias vim='vim -u /home/derf/dotfiles/vim/vimrc'
alias tmux='tmux -f /home/derf/dotfiles/tmux/tmux.conf'
http://github.com/fredsmith/dotfilesMy favorite is just to alias it all to a different name.
alias dg='git --git-dir=/Users/dragonfax/.dotfiles --work-tree=/Users/dragonfax'
now regular git doesn't overlap with my dotfiles git, and I never have to worry about mis-executing the wrong gitPretty good customizations by default with an elegant approach for adding local settings. The install.sh script automatically symlinks appropriate files as well as downloads vim bundles.
Conversely, I have a script that does this:
https://github.com/radiosilence/dotfiles/blob/master/relink
All I have to do is maintain a MANIFEST file.
edit: I use xstow for managing ~/opt -- putting stuff like ~/opt/xstow/golang-git, with symlinks to ~/opt/{bin,lib,man} -- making it easy to add the relevant folders to PATH, MANPATH etc in .bashrc.
When you re-install a Windows system, do you overwrite the registery with a backup you had? I doubt it.
yes, you need ruby for it but I dont really see that as a problem. Its a bit confusing at first (could be just me, but I still dont get why you have basically 2 repos, one managed by homesick and the one you checked out yourself) but it works fairly well. Takes care of symlinking, updating and whatever you want.
consider adding support to modify existing dot files as well as replace them.
[0] https://github.com/seletskiy/dotfiles/blob/master/dotfiles.s...
The public repository has .bashrc, etc in it. The private repository has ~/.mutt/work-muttrc, etc in it.