1

I have a shared directory on a computer in LAN which contains a Git repository. Now I am trying to add it as a submodule to one of my repositories.

I have tried :

git.exe submodule add -- \\Remote-PC\SharedDirectory\module1 module1

But when I run this command, it fails with the following error :

repo URL: '\\Remote-PC\SharedDirectory\module1' must be absolute or begin with ./|../

I don't know why it gives this error. Is it possible to add a shared directory as a submodule?

Nejat
  • 31,784
  • 12
  • 106
  • 138
  • Why the `--`? It's not the issue, I'm just not sure why you'd need it. – Gauthier May 21 '15 at 07:13
  • @Gauthier Actually I am using SmartGit and the command is the one that SmartGit generates when the wizard of adding a submodule is completed. – Nejat May 21 '15 at 07:30

1 Answers1

3

From "git on UNC path", you have the choice between:

  • bind the UNC path as a network drive
  • try and use /: //Remote-PC/SharedDirectory/module1
  • escape the backslash: \\\\Remote-PC\\SharedDirectory\\module1 (the OP reports it doesn't work for him)

For performance, make sure to use a Git 2.1+ (as in git for Windows 2.4.1)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250