Git clone: ​​warning: -depth is ignored in local clones; use file: // instead

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

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

He gave me this warning and made a complete clone:

 warning: --depth is ignored in local clones; use file:// instead. 
+6
source share
1 answer

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

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

It should have been 4 slashes, not 3, which was a bit unexpected. I'm still not sure why he insists on file://// , but I think this is just a fad.

+6
source

Source: https://habr.com/ru/post/1011950/


All Articles