使用 copssh、msysgit 克隆我的新 Windows 7 Git 服务器失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5695132/
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-15 16:40:25  来源:igfitidea点击:

Clone failing against my new Windows 7 Git server using copssh, msysgit

windowsgitclonehead

提问by wirestealth

I have created a git server on my Windows 7 box following Tim Davis' tutorialGot everything working up to the part of actually trying to clone the repository. I have a repo located on my server at: C:\SSH\home\repos\testapp.git that I have initialized using git --bare init as per the tutorial, and try to clone it using GiT GUI via: ssh://repos@myurl/SSH/home/repos/testapp.git

我按照Tim Davis 的教程在我的 Windows 7 机器上创建了一个 git 服务器 。我在我的服务器上有一个 repo:C:\SSH\home\repos\testapp.git,我已经按照教程使用 git --bare init 进行了初始化,并尝试通过以下方式使用 GiT GUI 克隆它:ssh:/ /repos@myurl/SSH/home/repos/testapp.git

but get an error dialog popping up describing "Clone failed. Cannot determine HEAD. See console output for details." and "Couldn't find remote ref HEAD".

但会弹出一个错误对话框,描述“克隆失败。无法确定 HEAD。有关详细信息,请参阅控制台输出。” 和“找不到远程参考头”。

I tried making a new repo out of an existing project folder (hoping that this 'ref' would magically correct itself) but the same thing message occurs.

我尝试从现有的项目文件夹中创建一个新的 repo(希望这个 'ref' 会神奇地自行纠正),但出现了同样的消息。

Is there something more after a '--bare' or an 'init' that needs to be done to set the head reference?

'--bare' 或 'init' 之后还有什么需要设置头部引用吗?

回答by manojlds

Most probably it's failing because it is an empty repository. You can try to add an initial ( dummy commit if needed ) to the repository and try the cloning again. Steps below if you don't know to do this.

很可能它失败了,因为它是一个空的存储库。您可以尝试向存储库添加初始(如果需要,虚拟提交)并再次尝试克隆。如果您不知道这样做,请执行以下步骤。

Can you do this:

你能做这个吗:

cd /home/repos
mkdir testapp.wd
cd testapp.wd
git clone ../testapp.git .
<now add some file>
touch README
git add README
git commit -m "Adding a initial commit"
git push origin master
cd ..
rm -rf testapp.wd

Now see if you can do the clone that you were trying.

现在看看你是否可以做你正在尝试的克隆。

回答by user8688293

If remote repository is empty, it will happen. Try to commit something.

如果远程存储库是空的,它就会发生。尝试提交一些东西。