Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot clone GIT repository on network drive

Using Windows 7, we have a bare GIT repository set up on a network drive so that multiple users can pull/push from it. I am able to create a new working repo on my local and multiple other networked drives. However, when I try to clone a new working repository on the same network drive (different folder) , it fails.

Using TortoiseGIT, after I right-click and choose "GIT Clone", put in all of the necessary paths to my bare repo (the new working repo is already filled in) and hit ok, I get the following error:

Cloning into 'R:\path\to\new\repo'... done. 
error: refs/remotes/origin/master does not point to a valid object! 
error: Trying to write ref refs/heads/master with nonexistent object 5d2164db2c61efc7a5598f6ff75ed3fbbb12456e 
fatal: Cannot update the ref 'HEAD'. 
fatal: The remote end hung up unexpectedly git did not exit cleanly (exit code 128)

and it fails to create the repo. It does however build the new folder & ".git" subfolder structure.

It's not a r/w permissions issue because I can r/w any other files, but just cannot seem to create this newly cloned repo. My co-worker cannot either. Even if I got to another folder on the network drive, I still cannot clone the repo successfully. Surprisingly, if I just copy/paste a repo I created in another location, then manually do a "pull", it works and updates successfully.

Any ideas on what to try next? Obviously I've Googled "exit code 128" and "cannot update the ref 'HEAD'" but cannot find a solution to my issue. It's probably something really simple that we are overlooking, but we're just getting started with GIT and this is really causing us headaches...

UPDATE: I just noticed that when I do a manual pull from GIT to my "copy", it is doing a Fast-Forward. Maybe this provides some additional clues?

From R:/path/to/repo
* branch            master     -> FETCH_HEAD
Updating 5d2164d..d75bdb7
Fast-forward
Files.py |    3 +++
1 file changed, 3 insertions(+)
Success
like image 664
RyanKDalton Avatar asked Dec 05 '12 00:12

RyanKDalton


1 Answers

Git might be trying to do some smart stuff with hardlinks that fails on the network drive. Try using git clone --no-hardlinks /r/path/to/my/repo or git clone file:///r/path/to/my/repo

like image 179
Chronial Avatar answered Sep 30 '22 03:09

Chronial