若已经拉取了代码,则不用走上面的步骤。 2、进入仓库目录,在Config中允许使用Sparse Checkout模式: git config core.sparsecheckouttrue 3、创建sparse-checkout文件 touch.git/info/sparse-checkout 4、编辑.git/info/sparse-checkout vim .git/info/spars
在官方的一个文档中介绍了“Sparse checkout”,链接如下:https://schacon.github.io/git/git-read-tree.html#_sparse_checkout ,其中讲到: "Sparse checkout" allows to sparsely populate working directory. It uses skip-worktree bit (see git-update-index(1)) to tell Git whether a file on working d...
情况 2:当您已经克隆了一个存储库时 cd git-srcgit config core.sparseCheckout trueecho "/assets/" >> .git/info/sparse-checkoutrm -rf <other-file/folder-you-dont-need>git checkout 禁用 git sparse-checkout git config core.sparseCheckout falsegit read-tree --emptygit reset --hard ...
Also, historically,initwould not actually initialize the sparse-checkout file if it already existed. This meant it was possible to return to a sparse-checkout without remembering which paths to pass to a subsequentsetoraddcommand. However,--coneand--sparse-indexoptions would not be remembered ac...
Also, historically,initwould not actually initialize the sparse-checkout file if it already existed. This meant it was possible to return to a sparse-checkout without remembering which paths to pass to a subsequentsetoraddcommand. However,--coneand--sparse-indexoptions would not be remembered ac...
git的sparse checkout功能 解决仓库太大,只想拉取一部分内容的需求:
1.开启sparse checkout功能 开启: git config core.sparsecheckout true 或者 git sparse-checkout init 2.写入要获取的文件 1)写入文件: echo "x x x" >> .git/info/sparse-checkout 例如: echo "Test" >> .git/info/sparse-checkout 表示只拉取Test文件夹, 或者使用命令 ...
2、 添加 checkout 列表 使用文本编辑打开.git/info/sparse-checkout文件 (没有这个文件可以手动创建一个) 添加如下列表。 代码语言:javascript 代码运行次数:0 运行 AI代码解释 /* !/add_on/native_addon/kylinv4_ft1500a/* !/add_on/native_addon/neokylin_lib/* ...
echo “path/to/file” >> .git/info/sparse-checkout git pull origin master “` 这将仅拉取指定的文件或目录,并将其放置在当前工作目录中。 3. 使用git cherry-pick命令 git cherry-pick命令可以选择性地提交某个分支的部分提交。如果我们只想拉取另一个分支的某个提交到当前分支,可以使用以下命令: ...
Sparsely checkout single tag from a remote repo url.Resolve a tag on a remote repo url, then check if you have the commit local, otherwise fetch the pack for that commit, and sparsely checkout trees within the commit to mapped prefixes.import gitSparseCheckout from "git-sparse-checkout";...