tags:

views:

33

answers:

1

I'm trying to output a git log from another folder on the server without having to cd into it first.

git log /path/to/repo

returns

fatal: Not a git repository

For the life of me, I can't find the switch to tell it to operate on/in a different path than .

Thanks.

+3  A: 

Try:

git --git-dir=/path/to/repo/.git log
Charles Bailey
And for commands that need to look at the work tree, there's the `--work-tree` option.
Jefromi
There are also environment variables that do this as well: `GIT_DIR` and `GIT_WORK_TREE`. For full details, see the Options section in http://www.kernel.org/pub/software/scm/git/docs/.
MikeSep
Thanks guys - this is very helpful
jmccartie