I have been trying to clone a local Git repository for about an hour now. The repository is on a Windows 7 server, and I am trying to make a clone right next to it. My workflow is to clone the repository, make some changes, and test. If all is good, I pull the changes back into the original repository and delete the clone.
I am using Git Bash (part of Tortoise Git). The repository is on a mapped network drive. I was having some issues cloning because of the drive, so I read this:
git clone from another directory
I then did the following:
spearsc@BB-DIGI-SPEARSC MINGW64 /r/nasenv (master)
$ git clone . /r/nasenv_copy
Cloning into 'R:/nasenv_copy'...
done.
error: internal error: refs/remotes/origin/master is not a valid packed reference!
fatal: update_ref failed for ref 'HEAD': cannot update ref 'refs/heads/master': trying to write ref 'refs/heads/master' with nonexistent object 1fa512cca95695979f35515f1ea69c391d214544
fatal: The remote end hung up unexpectedly
The resulting repo is empty except for a .git folder. From past experience, I thought the issue was the mapped drive (in this case R).
I tried the following:
spearsc@BB-DIGI-SPEARSC MINGW64 /r/nasenv (master)
$ git clone . file://r:\nasenv_copy
fatal: could not create leading directories of 'file://r:nasenv_copy': Invalid argument
spearsc@BB-DIGI-SPEARSC MINGW64 /r/nasenv (master)
$ git clone . file://r:/nasenv_copy
fatal: could not create leading directories of 'file://r:/nasenv_copy': Invalid argument
spearsc@BB-DIGI-SPEARSC MINGW64 /r/nasenv (master)
$ git clone . file://r/nasenv_copy
fatal: could not create leading directories of 'file://r/nasenv_copy': Invalid argument
spearsc@BB-DIGI-SPEARSC MINGW64 /r/nasenv (master)
$ git clone . file://R:/nasenv_copy
fatal: could not create leading directories of 'file://R:/nasenv_copy': Invalid argument
None of these work. This is really frustrating because I did do this last week. I'm not sure if I just forgot or if a change in the main repo is causing this.