[英]When cloning an svn repository into git, should I clone only trunk, or the entire repo?
[英]Obtain only a specific folder from a repository without cloning the entire repo
我已經嘗試了所有可以在網上找到的方法,但我就是無法完成這項工作。 我在 Github 中有多個利用操作的存儲庫。 我所說的倍數是指推動 1K(實際上不是我的,但長篇大論)。 我只需要檢索 /.github 文件夾和其中的所有文件,我不想要整個存儲庫。 我需要掃描 YAML 文件的工作流程和操作,以了解這些實際在做什么,例如構建代碼、測試、構建和測試等。有人可以幫我解決這個問題嗎,稀疏的結帳似乎沒有工作。
謝謝!
如果要對 repo 進行部分“克隆”,可以使用稀疏結帳:
# work folder
mkdir partialrepo
cd partialrepo
# new empty repo
git init
# point local repo at remote without cloning
git remote add -g origin https://pathtorepo
# enable sparse checkout
git config core.sparseCheckout true
# enumerate paths to check out
echo ".github" >> .git/info/sparse-checkout
# and pull them
git pull origin whateverbranchyouwanttopull
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.