# Not a git repository: '.'

3 messages from 2012-03-24 to 2012-03-25. Participants: greened@obbligato.org, Johannes Sixt.
Thread: https://gitlist.dev/t/30050

## greened@obbligato.org, 2012-03-24 17:26

Subject: Not a git repository: '.'
Message-ID: <87r4wh6hce.fsf@smith.obbligato.org>
URL: https://gitlist.dev/e/87r4wh6hce.fsf%40smith.obbligato.org

```
I have a post-receive hook set up that does the following when something
is pushed to a repository.

- Change directory to another non-bare repository
- Do 'git status'

I get this error from the original git push:

remote: fatal: Not a git repository: '.'

Debug output tells me I am in the correct directory when attempting the
status check.  This directory is a full git workarea (i.e. not a bare
repository).

Any idea what git is complaining about?  I can log on to the server and
do 'git status' in the target directory and everything is fine.

                            -Dave

```

## Johannes Sixt, 2012-03-24 18:14

Subject: Re: Not a git repository: '.'
Message-ID: <4F6E0F07.6030400@kdbg.org>
URL: https://gitlist.dev/e/4F6E0F07.6030400%40kdbg.org
In-Reply-To: <87r4wh6hce.fsf@smith.obbligato.org>

```
Am 24.03.2012 18:26, schrieb greened@obbligato.org:
> I have a post-receive hook set up that does the following when something
> is pushed to a repository.
> 
> - Change directory to another non-bare repository
> - Do 'git status'
> 
> I get this error from the original git push:
> 
> remote: fatal: Not a git repository: '.'
> 
> Debug output tells me I am in the correct directory when attempting the
> status check.  This directory is a full git workarea (i.e. not a bare
> repository).
> 
> Any idea what git is complaining about?  I can log on to the server and
> do 'git status' in the target directory and everything is fine.

Most likely, GIT_DIR=. is set when the hook is entered. Does unset
GIT_DIR help?

-- Hannes

```

## greened@obbligato.org, 2012-03-25 21:59

Subject: Re: Not a git repository: '.'
Message-ID: <877gy8e3z8.fsf@smith.obbligato.org>
URL: https://gitlist.dev/e/877gy8e3z8.fsf%40smith.obbligato.org
In-Reply-To: <4F6E0F07.6030400@kdbg.org>

```
Johannes Sixt <j6t@kdbg.org> writes:

> Most likely, GIT_DIR=. is set when the hook is entered. Does unset
> GIT_DIR help?

That was indeed the problem.  Thank you!

                        -Dave

```
