# Detecting GIT_DIR runtime

3 messages from 2010-05-05 to 2010-05-05. Participants: Mahesh Vaidya, Tomas Carnecky, Jeff King.
Thread: https://gitlist.dev/t/23711

## Mahesh Vaidya, 2010-05-05 15:38

Subject: Detecting GIT_DIR runtime
Message-ID: <t2gb42431c81005050838w425412d9jfe176c3b637e77c1@mail.gmail.com>
URL: https://gitlist.dev/e/t2gb42431c81005050838w425412d9jfe176c3b637e77c1%40mail.gmail.com

```
I have a tree like
/home/mvaidya/WORKSPACE/nvos/mvaidya-master-100.local/some/folder

I would like to issue come command say "git fetch" from any level of
the tree. How can I deduce path of .git folder. Reason I need it as I
some application configuration saved in .git/workspace.properties and
I need to some action before git fetch.



-- 
Thank you and best regards.
Mahesh Vaidya  / 9740500144
http://www.twitter.com/forvaidya

```

## Tomas Carnecky, 2010-05-05 16:54

Subject: Re: Detecting GIT_DIR runtime
Message-ID: <4BE1A2C9.6010408@dbservice.com>
URL: https://gitlist.dev/e/4BE1A2C9.6010408%40dbservice.com
In-Reply-To: <t2gb42431c81005050838w425412d9jfe176c3b637e77c1@mail.gmail.com>

```
On 5/5/10 5:38 PM, Mahesh Vaidya wrote:
> I have a tree like
> /home/mvaidya/WORKSPACE/nvos/mvaidya-master-100.local/some/folder
>
> I would like to issue come command say "git fetch" from any level of
> the tree. How can I deduce path of .git folder. Reason I need it as I
> some application configuration saved in .git/workspace.properties and
> I need to some action before git fetch.
>

Take a look at:
$ git rev-parse --cdup

tom

```

## Jeff King, 2010-05-05 18:14

Subject: Re: Detecting GIT_DIR runtime
Message-ID: <20100505181420.GB1556@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20100505181420.GB1556%40coredump.intra.peff.net
In-Reply-To: <4BE1A2C9.6010408@dbservice.com>

```
On Wed, May 05, 2010 at 06:54:33PM +0200, Tomas Carnecky wrote:

> On 5/5/10 5:38 PM, Mahesh Vaidya wrote:
> >I have a tree like
> >/home/mvaidya/WORKSPACE/nvos/mvaidya-master-100.local/some/folder
> >
> >I would like to issue come command say "git fetch" from any level of
> >the tree. How can I deduce path of .git folder. Reason I need it as I
> >some application configuration saved in .git/workspace.properties and
> >I need to some action before git fetch.
> >
> 
> Take a look at:
> $ git rev-parse --cdup

Or even "git rev-parse --git-dir".

-Peff

```
