Am 25.03.2013 23:20, schrieb Junio C Hamano:
Richard Weinberger <richard@xxxxxx> writes:
Okay, I have to set GIT_DIR _and_ GIT_WORK_TREE to make my scripts safe again?
I've always set only GIT_DIR because it just worked (till today...).
That means you never run your script inside a subdirectory ;-)
If your $GIT_DIR is tied to a single working tree, a simpler way
would be to add
[core]
worktree = /path/to/the/work/tree/
I've used GIT_DIR in my scripts because changing the current working directory
within bash scripts often causes problem with other commands.
That's why I've used patters like:
export GIT_DIR=/path/to/repo/.git
git fetch ...
do_this
do_that
git reset --hard FETCH_HEAD
do_foo
git whatever
export GIT_DIR=/path/to/another/repo/.git
git fetch ...
...
But from now on I'll simply cd into the git repo...
Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html