WeBWorK Main Forum

not a git repository

not a git repository

by Andras Balogh -
Number of replies: 6

Would like to update to 2.17 from 2.16 but for some reason the way the 2.16 was installed was that the git clone was done in a download directory and then the files were moved into place. 

As a consequence, git fetch origin results in 
fatal: not a git repository (or any parent up to mount point /)

I guess there is nothing I can do now to make git think that it is updating something, since there are no update files?

Do I just rename the webwork2 and pg directories and get a new "real" clone? 

In reply to Andras Balogh

Re: not a git repository

by Andras Balogh -
Answering my own question: The good thing is that the git files were also moved over. The problem was that I cloned the directory as root and then changed the ownership to wwadmin, then tried to git fetch origin as wwadmin.
In reply to Andras Balogh

Re: not a git repository

by Glenn Rice -
So I got caught in a cross post race and lost.

In any case, you should do "chown -R wwadmin:wwadmin .git" in /opt/webwork/webwork2 and /opt/webwork/pg to fix the ownership.
In reply to Glenn Rice

Re: not a git repository

by Andras Balogh -
Thanks!
Does it matter if it is wwadmin:wwadmin or wwadmin:wwdata ??

I have been shaky with webwork file permissions and ownerships for many years now and did learn that sometimes I have to fix them manually.
In reply to Andras Balogh

Re: not a git repository

by Glenn Rice -

It would work either way.  The most important thing is that the .git directory be owned by your user (wwadmin).  However, the most secure set up would be for the directory to also be in your user's group.  So wwadmin:wwadmin is my advice.

In reply to Andras Balogh

Re: not a git repository

by Glenn Rice -

If you git a real git clone of webwork2 in another location, and then copy the ".git" subdirectory of that git clone into /opt/webwork/webwork2, then git will believe that directory is a git clone (in fact it now will be).  Do the same for pg.