Skip to contentSkip to conversation

Not a git repository: '.'

DISCUSSION [email protected] 2 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw

Am 24.03.2012 18:26, schrieb [email protected]:

Quoted 8 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:

Quoted 8 lines

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

#2 lore raw
Quoted 2 lines · Johannes Sixt

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

That was indeed the problem. Thank you!

-Dave