---
title: "古いリポジトリをshallow cloneする"
description: "作業するリポジトリでGitの全履歴が必要ない場合は、クローンの深さを指定して、リポジトリの直近x個のリビジョンだけをクローンできます。"
canonical: https://oozou.com/til/shallow-clone-a-old-repo-2
locale: ja
date: 2020-10-13
topic: shell
---

# 古いリポジトリをshallow cloneする

> 作業するリポジトリでGitの全履歴が必要ない場合は、クローンの深さを指定して、リポジトリの直近x個のリビジョンだけをクローンできます。

Published: 2020-10-13 · Topic: [shell](https://oozou.com/ja/til-topics/shell) ([markdown](https://oozou.com/ja/til-topics/shell.md))

作業するリポジトリでGitの全履歴が必要ない場合は、クローンの深さを指定して、リポジトリの直近x個のリビジョンだけをクローンできます。

*git clone --depth=1 https://github.com/my/repo.git*

---

Contact OOZOU: hello@oozou.com · +66 2544 0000 · https://oozou.com/ja/contact

More for AI agents: https://oozou.com/llms.txt · every page has a markdown twin at its URL plus ".md"
