git on UNC path

后端 未结 7 1789
南方客
南方客 2020-12-10 00:33

I have computer with Windows XP and no Internet connection, only access to network drive. I\'d like to set up a git repository on the network drive and then push to it from

相关标签:
7条回答
  • 2020-12-10 01:03

    There's a similar (but not quite the same) issue discussed on the msysGit mailing list (and back when it was active, the issue-tracker). While that issue is about the "Git bash here"-feature from UNC, the solution might be similar. Perhaps some of these links will help you find a solution:

    • http://groups.google.com/group/msysgit/browse_thread/thread/1267781387a4c080
    • http://code.google.com/p/msysgit/issues/detail?id=535

    And if you find a solution, please consider to submit the fix back to the msysGit project :)

    0 讨论(0)
  • 2020-12-10 01:06

    First open a windows console, Run->cmd

    pushd \\172.158.1.254\network_usb
    

    now you should be able to 'cd' through all the directories on the drive. Optionally you can type a git init --bare nameOfnewRepo.git somewhere.

    popd
    

    Now open git bash and cd to the location where you want to clone the repo on the network drive

    git clone //172.158.1.254/network_usb/pathto/nameOfnewRepo.git
    

    Note that in git bash the slashes are forward and in the windows console backward.

    0 讨论(0)
  • 2020-12-10 01:09

    It seems that there is a register value that allows to use UNC paths on cmd. You can set up the register by running this on cmd:

    reg add “HKCU\Software\Microsoft\Command Processor” /v DisableUNCCheck /t REG_DWORD /d 0x1 /f
    

    Source

    0 讨论(0)
  • 2020-12-10 01:13

    As Konstantin said, "//comp1/Proj/git/SDK/" works fine as a UNC path.

    Others mentioned poor performance using a remote file system, which I cannot reproduce. Cloning the same repo took 3min45 through encrypted VPN file system access and 3min25 through unencrypted HTTP (Bonobo Git Server). The secure channel + windows authentication for repo access is certainly worth the extra 10%.

    Note that Cygwin's "git" command does not work with this remote path. The git.exe that comes bundled with GitExtensions works fine, VS2015 works fine too.

    0 讨论(0)
  • 2020-12-10 01:27

    Just use the UNC path - git doesn't care what cmd can and cannot do.


    Old answer: Bind the UNC path to a drive letter (or use a directory symlink).

    0 讨论(0)
  • 2020-12-10 01:27

    Check if you actually have access to your local drive. Installing it there would be the easiest solution.

    0 讨论(0)
提交回复
热议问题