配置现有的git回购稀疏结帐 [英] configuring existing git repo for sparse checkout
问题描述
是否有可能配置现有的本地克隆git仓库进行稀疏结算?
指向执行 git init
和 git remote add -f origin< repo>
这会导致我的情况很长的下载时间。
我本地已有一个存储库,我只想将其配置为稀疏检出,然后切换到特定分支。
非常感谢!
p>您仍然可以使用此答案: https://stackoverflow.com/a/4909267/2253302
但是你应该跳过一些步骤(即 git init
和
git remote add -f origin< repo>
)。我在我的测试回购中检查了这些步骤:
$ b
- 在您的repo中启用sparseCheckout:
git config core.sparseCheckout true
- 为sparseCheckout添加路径
echo testSparseCheckout> .git / info / sparse-checkout
- 结帐至您想要的分行
这个场景适用于我的小测试git回购。
Is it possible to configure an existing local clone of a git repository for sparse checkout?
Existing discussion points to performing git init
and git remote add -f origin <repo>
which results in long download times for my situation.
I already have a repository locally and I just want to configure it for sparse checkout and then switch to a particular branch.
Thanks very much!
You still can use this answer: https://stackoverflow.com/a/4909267/2253302
But you should skip some steps (i.e git init
and git remote add -f origin <repo>
). I check this steps for my test repo:
- Enable sparseCheckout in your repo:
git config core.sparseCheckout true
- Add path for sparseCheckout
echo testSparseCheckout > .git/info/sparse-checkout
- Checkout to your desired branch
This scenario works for me well on my small testing git repo.
这篇关于配置现有的git回购稀疏结帐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!