building iOS project after git push (using gitolite hooks) and getting fatal: Not a git repository: '.'

Go To StackoverFlow.com

0

background: I'm following this tutorial, except that I'm not using jenkins: http://parveenkaler.com/2012/02/04/continuous-deployment-for-ios-apps/

When the script executes: git show -s --format=%s

I'm getting this error

fatal: Not a git repository: '.'

But I do not understand why I would be seeing that error since it obviously has to be a valid git repo otherwise those files wouldn't exist (the temp folder is created via git clone in the post-update gitolite hook and deleted before the build, ie the script, begins).

This is being run on a mac with Lion installed.

any thoughts? Thanks

EDIT: I added a ls -lF -d .git to the build script, here is the output

drwx------  13 USERNAME  admin  442  4 Apr 13:47 .git/
remote: fatal: Not a git repository: '.'

Here is the script part mentioned above, so you can see the context of the line being executed:


ls -lF -d .git

/usr/local/git/bin/git show -s --format=%s > log.txt

2012-04-04 19:19
by cbrulak


0

It is only an obvious git repository if there is a 'git' directory at or above the current directory. From the location where you tried 'git show' start looking with:

ls -lF -d .git

and then move upwards until you find it. (There shouldn't be one because 'git show' failed.) Alternatively, go to some top-level directory and search for git repositories with:

find . -type d -name '.git'
2012-04-04 19:43
by GoZoner
ok, did the first ls you suggested here is the output: drwx------ 13 USERNAME admin 442 4 Apr 13:47 .git/ remote: fatal: Not a git repository: '. - cbrulak 2012-04-04 19:48
And 'USERNAME' is your username? If it is not you, then the git command is not going to be able to see the contents. You can remedy the problem in one of two ways: 1) if you are in the admin group, then get USERNAME to do 'chmod 770 .git' or 2) if you are not in the admin group, then get USERNAME to change the group to something you are in with 'chgrp .git' and then perform #1. Note, or become superuser and do the above yourself - GoZoner 2012-04-04 20:04
USERNAME is the right user's login id - cbrulak 2012-04-04 21:03
So the script running 'git show' is running as 'USERNAME'? A simple check would be 'chmod 777 .git' and then see if your script works - GoZoner 2012-04-04 21:22
Ads