Barzi2001
Barzi2001

Reputation: 1766

Creating a git remote on a Windows network location using SourceTree: fatal: unable to get current working directory: No error

I want to create a remote repo in a network place with Windows name \\company.net\dumptruck\repos\MyRepo by using SourceTree. I have read around but I haven't found a solution to my case. Here is what I have done.

  1. I tried to open the terminal from SourceTree but it didn't open. This because I guess you need to create/clone a repo first.
  2. Then I have tried to create a new repo through the SourceTree GUI by providing either \\company.net\dumptruck\repos\ and //company.net/dumptruck/repos/ as path. In both the cases I got the error fatal: unable to get current working directory: No error
  3. I thought that it may be better to go with the Command Line. Therefore, I created a local repo in C:\Somewhere\MyRepo in order to be able to open the terminal. Then, I issued cd //company.net/dumptruck/repos/ followed by git init --bare. I get the same error as before: fatal: unable to get current working directory: No error Note that I can reach the folder //company.net/dumptruck/repos/
  4. Both the commands pwd and echo $PWD provide //company/dumptruck/repos/

Any hint?

Upvotes: 2

Views: 1982

Answers (2)

Barzi2001
Barzi2001

Reputation: 1766

I continue the discussion here since I am not allowed to write in the comments box (too many characters).

Both the commands pwd and echo $PWD provide //company.net/dumptruck/repos/. Sorry, my bad in my previous comment.

Nevertheless, I tried to issue the following commands from GitForWindows and from the terminal provided by SourceTree (that should be MINGW32):

cd '//company.net/dumptruck/repos/'
git init --bare 

In both the cases I got

error: unable to create directory for //company.net/dumptruck/repos/HEAD 

I asked a colleague of mine to perform the same with his client (he uses Cygwin). Everything seemed to work smoothly.

In reality, I am allowed to clone the repo, but I am not allowed to push into it. I guess the problem may rely either on the permission or on the path. We adjust the permissions, but the problem was still there.

All the problems got solved by mapping the network location into a network drive. I personally don't like using network drives and I wonder if there is a way for making everything to work just by using network location names.

Upvotes: 1

Stryker
Stryker

Reputation: 6120

Do you have enough rights to read and write to these directories? You may have to run these as administrator.

Upvotes: 0

Related Questions