git clone子文件夹

最近想git clone 一个项目的说明下来,这个项目说明又分为两种语言的,如图

git clone子文件夹

但是我只想clone en version to my local repository

看了下stackover flow  

/////////////////////////////////////////////////////////////////////////////////////////////////////

EDIT: As of Git 2.19, this is finally possible, as can be seen in this answer: https://*.com/a/52269934/2988.

Consider upvoting that answer.

Note: in Git 2.19, only client-side support is implemented, server-side support is still missing, so it only works when cloning local repositories. Also note that large Git hosters, e.g. GitHub, don't actually use the Git server, they use their own implementation, so even if support shows up in the Git server, it does not automatically mean that it works on Git hosters. (OTOH, since they don't use the Git server, they could implement it faster in their own implementations before it shows up in Git server.)


No, that's not possible in Git.

Implementing something like this in Git would be a substantial effort and it would mean that the integrity of the clientside repository could no longer be guaranteed. If you are interested, search for discussions on "sparse clone" and "sparse fetch" on the git mailinglist.

In general, the consensus in the Git community is that if you have several directories that are always checked out independently, then these are really two different projects and should live in two different repositories. You can glue them back together using Git Submodules.

说了那么多,我不太懂他的clientside 反正这个高赞回答是说不可以,而且建议每个项目分开然后再用git submodules 的方式去粘合起来。

然后后面还有介绍了其他很多方法的,但是这个不重要

https://*.com/questions/600079/how-do-i-clone-a-subdirectory-only-of-a-git-repository

下面的都是git server都是自己initailize 的但是github的server 的implementation不清楚

不过我之前有看过想multigit这种东西。