DEV Community

KOGA Mitsuhiro
KOGA Mitsuhiro

Posted on • Originally published at qiita.com

巨大なGitリポジトリのOculus-VR/UnrealEngineからサンプルだけをダウンロードする

はじめに

Oculusの開発者センターにUnreal Samplesのリンクがあるのですが、Gitリポジトリが巨大でダウンロードに時間がかかるのでサンプルのみダウンロードしてみました。

sparse checkout と shallow clone

詳細は 巨大なリポジトリ を Git で上手く扱う方法 の解説にあり

  • 一部のフォルダのみcheckoutするsparse checkout
  • 指定した履歴だけをcloneするshallow clone

この2つを組み合わせます。

UE4のOculusサンプルのみcloneする

次のコマンドで /Samples/Oculus/ フォルダのみcloneされます。

## 不要なfetchしないために、initとremote add originを組合せる
$ git init UnrealEngine
$ cd UnrealEngine
$ git remote add origin https://github.com/Oculus-VR/UnrealEngine.git


## sparse checkoutで/Samples/Oculus/のみcheckoutする
$ git config core.sparsecheckout true
$ echo /Samples/Oculus/ > .git/info/sparse-checkout


## checkoutしたいbranchが4.18なので同じ名前のbranchを作る
$ git checkout -b 4.18


## shallow cloneで履歴を1つだけにする
$ git pull origin 4.18 --depth 1

参考にしたリンク

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay