git clone:警告:--depth在本地克隆中被忽略;使用file://代替 [英] git clone: warning: --depth is ignored in local clones; use file:// instead

查看:1126
本文介绍了git clone:警告:--depth在本地克隆中被忽略;使用file://代替的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在本地网络的共享文件夹中有一个远程存储库。我试图做一个浅层克隆:

We have a remote repository on a shared folder in our local network. I attempted to make a shallow clone:

git clone --depth 1 //gitrepos-pc/git/foo/

它给了我这个警告,并且做了一个完整的克隆:

It gave me this warning, and made a full clone:

warning: --depth is ignored in local clones; use file:// instead.


推荐答案

好的,经过一些实验后,我得到了它,使用

Ok, after some experimenting I got it, I had to use

git clone --depth 1 file:////gitrepos-pc/git/foo/

必须是4个斜杠,而不是3个,这有点意外。我仍然不确定它为什么坚持 file://// ,但我想这只是一个怪癖而已。

It had to be 4 slashes, not 3, which was a bit unexpected. I am still not sure why it insists on file://// but I guess it's just a quirk.

这篇关于git clone:警告:--depth在本地克隆中被忽略;使用file://代替的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆