I'm curious about this too since something dead simple (and reasonably idiot-proof) would be useful to me as well.
I'm curious about this too since something dead simple (and reasonably idiot-proof) would be useful to me as well.
Having ~/dotfiles/.git and aliasing a command that sets GIT_DIR=~/dotfiles/.git and GIT_WORKDIR appropriately would be safer.
But your solution is definitely safer -- although I think you meant GIT_WORK_TREE, not GIT_WORKDIR, right? I'm going to switch. Thanks!
EDIT: Working nicely :) https://github.com/nixme/dotfiles/commit/64486fe25e6750567a0...
This is still risky if your ~/.git had uncommitted changes. I'll admit to being a little paranoid but I spent enough time on the #git irc channel to learn that any advice that is potentially dangerous will _always_ be used in the dangerous fashion, often without knowledge of the risks. > although I think you meant GIT_WORK_TREE, not GIT_WORKDIR, right?
Yeah, brain cramp on that one, sorry.