如何在远程Windows机器上指定git存储库的路径

时间:2018-03-01 06:54:34

标签: git

我在Windows server 2012计算机上的文件夹中有一个git存储库:

C:\Users\linhdh\source\repo\IOSProject

如何从Mac计算机为此存储库添加ssh远程URL?我尝试了一些网址:

git remote add origin ssh://linhdh@101.4.3.120/source/repo/IOSProject
git remote add origin ssh://linhdh@101.4.3.120/~/source/repo/IOSProject

但直到现在都没有工作。我每次都收到这条消息:

fatal: ''~/source/repo/IOSProject'' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

我确信我拥有正确的访问权限,并且存储库已存在。

1 个答案:

答案 0 :(得分:0)

我用以下命令解决了这个问题:

# work around the known issue by launching powershell to run the git commands
git config --local remote.origin.uploadpack "powershell git-upload-pack"
git config --local remote.origin.receivepack "powershell git-receive-pack"