这篇文章只是给自己的一个注释,它适用于我的环境。它尚未经过广泛测试。
就我而言,我克隆了一个 git repo exists problems on the Windows platform with some folder,为了在 Windows 平台上工作,我们得到了一个解决方案,如下所示:
情况 1:当您尚未克隆存储库时
mkdir git-src
cd git-src
git init
git config core.sparseCheckout true
echo "/assets/" >> .git/info/sparse-checkout
git remote add origin git@github.com:shenxianpeng/shenxianpeng.git
git fetch
git checkout master
情况 2:当您已经克隆了一个存储库时
cd git-src
git config core.sparseCheckout true
echo "/assets/" >> .git/info/sparse-checkout
rm -rf <other-file/folder-you-dont-need>
git checkout
git config core.sparseCheckout false
git read-tree --empty
git reset --hard
