Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git常用收集 #26

Open
zhangjunlei26 opened this issue Sep 3, 2021 · 0 comments
Open

Git常用收集 #26

zhangjunlei26 opened this issue Sep 3, 2021 · 0 comments

Comments

@zhangjunlei26
Copy link
Owner

检出git项目中指定目录下源码,不检出全部,适用于项目比较大时

EXT_PATH="some/path"
git init #初始化
git remote add origin https://gitxxx.com/someone/project.git   # 增加远端的仓库地址
git config core.sparsecheckout true # 设置Sparse Checkout 为true
echo "${EXT_PATH}" >> .git/info/sparse-checkout # 将要部分clone的目录相对根目录的路径写入配置文件
git pull [--depth 1] origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant