比如要下載這里的 data_utils
步驟
1、新建空文件夾,并進入新建的空文件夾。
2、git init
初始化
3、git remote add origin
添加遠程倉庫
4、git config core.sparsecheckout true
允許稀疏檢出
5、git sparse-checkout set
設(shè)置需要拉取的文件夾(可以同時拉取多個,中間加空格即可)
6、git pull origin main
拉取
添加
在已經(jīng)進行過稀疏檢出的文件夾中,添加其它文件夾。
使用git sparse-checkout add
。
結(jié)果:
ps:git sparse-checkout 和 git lfs 不兼容文章來源:http://www.zghlxwxcb.cn/news/detail-696213.html
參考資料:
https://www.git-scm.com/docs/git-sparse-checkout(官方文檔)
https://blog.csdn.net/shelutai/article/details/123116973
https://zhuanlan.zhihu.com/p/57390306
https://cloud.tencent.com/developer/article/2008489
https://github.com/git-lfs/git-lfs/issues/3803(git lfs issue)文章來源地址http://www.zghlxwxcb.cn/news/detail-696213.html
到了這里,關(guān)于Github 下載指定文件夾(git sparse-checkout)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!