致命的:不是 Git 存储库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1491978/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 07:07:54  来源:igfitidea点击:

fatal: Not a Git Repository

gitssh

提问by Michael Krelin - hacker

So I have SSH working now no problemo and I have setup a new git repo in my

所以我现在有 SSH 工作没有问题,我已经在我的

/home/Tom/Git/myapp.git

/home/Tom/Git/myapp.git

I provided access to another drive for hosting the repo so the directory "Git" actually exists on D:\ using

我提供了对另一个驱动器的访问来托管存储库,因此目录“Git”实际上存在于 D:\ 上,使用

ln -s /cygdrive/d/Git/myapp.git

ln -s /cygdrive/d/Git/myapp.git

Now when I attempt to clone my git repo using

现在,当我尝试使用以下命令克隆我的 git repo 时

ssh://name@ipaddress:port/Git/myapp.git

ssh://name@ipaddress:port/Git/myapp.git

I get a

我得到一个

fatal: '/Git/myapp.git' does not appear to be a git repository

致命:'/Git/myapp.git' 似乎不是 git 存储库

Any ideas ?

有任何想法吗 ?

Edit:I even created a directory just inside /Tom/myapp.git and tried to use

编辑:我什至在 /Tom/myapp.git 中创建了一个目录并尝试使用

git clone ssh://name@ipaddress:port/myapp.git

git clone ssh://name@ipaddress:port/myapp.git

And i still get the error? Also try

我仍然收到错误?也试试

git clone -v ssh://name@ipaddress:port/~/myapp.git

git clone -v ssh://name@ipaddress:port/~/myapp.git

Error is

错误是

fatal: '~/myapp.git' does not appear to be a git repository
Initialized empty Git repository in D:/Local/myapp/.git/
fatal: The remote end hung up unexpectedly

致命:'~/myapp.git' 似乎不是一个 git 存储
库在 D:/Local/myapp/.git/ 中初始化空的 Git 存储库
致命:远程端意外挂断

回答by Michael Krelin - hacker

Try

尝试

git clone ssh://name@ipaddress:port/~/Git/myapp.git

git clone ssh://name@ipaddress:port/~/Git/myapp.git

(the important bit is ~path component).

(重要的一点是~路径组件)。