threads / discuss / 30050

Not a git repository: '.'

Subject: Not a git repository: '.'

## tl;dr

3 messages between Mar 24, 2012 and Mar 25, 2012.

replies: 2people: 2as markdown or json

greened@obbligato.org· Mar 24, 2012, 17:26 UTC · lore

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· Mar 24, 2012, 18:14 UTC · re: greened@obbligato.org · lore

Re: Not a git repository: '.'

Am 24.03.2012 18:26, schrieb greened@obbligato.org:
Show 16 quoted lines
> 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

← back to recent threads