K
K
KrD2013-09-30 10:05:14
git
KrD, 2013-09-30 10:05:14

How to make Git friends with a network folder?

Nota bene: I'm posting a question from my friend Ve1xeor

The peculiarities of the work force me to use Git in a somewhat unconventional way:
I store the repository on a local disk, while the working copy is located on a remote server, which is accessed through a mapped network drive. I have Windows 7 x86 and Git 1.8.4 (git-1.8.4-preview20130916.exe) on my machine, the server is supposedly on Linux, I have full rights to work in the network folder (rwx).

Below I will describe how I create the repository:
in the Explorer I go to the \\server\workingfolder directory, in the directory I call the console (Rclick -> Git Bash)

$ git init --separate-git-dir=/C/my_repo.git
An empty repository is created in the C:\my_repo.git folder, an inconspicuous .git file is created in the \\server\workingfolder folder;
and here comes the problem:
$ git add .
fatal: Unable to create `//server/workingfolder/../../../C:/my_repo.git/index.lock` No such file or directory

No matter how much I fought, I could not solve this problem, and it remains unclear
why Git uses a relative path from the working folder to the repository.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
mayorovp, 2013-10-01
@KrD

Try git from cygwin - since cygwin emulates the root file system, this problem may disappear.

N
Nikolai Vasilchuk, 2013-09-30
@Anonym

Map a network drive and work as usual.

M
Maxim Dyachenko, 2013-09-30
@Mendel

I believe that you (or rather, as I understand Dima's?) Git is trying to write to the original repository based on the current situation.
Those. we are not clear where, and the repository is on Tse. We are trying to build a path to it, but since the native environment is Linux, this does not work out for us.
Let's define the task.
If I understand correctly, then the task is to synchronize the developer's repository with production on a network drive?
If so, then you need to make TWO repositories and synchronize them via pull / push.
If I misunderstood the problem, can you elaborate?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question