簡體   English   中英

如何使用Git Bash使用Windows網絡路徑

[英]How to use Windows network paths with Git Bash

Windows中使用\\\\servername\\share\\path\\to\\folder語法表示網絡資源的\\\\servername\\share\\path\\to\\folder 如何在使用Unix風格路徑的Git Bash中使用這樣的文件夾?

實際上只是cd //servername/share/path/to/folder其中//servername/后面跟着至少一個共享文件夾。

您需要將驅動器號與要使用的網絡路徑相關聯。 為此,請在Windows cmd shell中執行以下命令:

pushd \\servername\share\path\to\folder

下一個提示將攜帶指定的驅動器號,例如Z:\\path\\to\\folder 現在,打開Git Bash(它不能用於已經運行的實例)並轉到新創建的驅動器號:

cd Z:/path/to/folder

或同等地

cd /z/path/to/folder

其實

git clone //servername/path/to/repo.git

對我來說很好用(使用git version 1.9.0.msysgit.0

如果您需要克隆,那么更合適的答案在這里

git clone file:////<host>/<share>/<path>

注意單詞file和后面的4 slashes ,這就是技巧。

無需手動鍵入路徑。 只需右擊! 在您的存儲庫上,單擊Git Bash選項。 它將使用您的存儲庫路徑打開git bash。

在此輸入圖像描述

此外,我建議使用Windows的Mp網絡驅動器選項將網絡位置映射為驅動器,並僅使用它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM