克隆git仓库没有历史吗?

克隆git仓库没有历史吗?

问题描述:

我想要从github克隆存储库.它有很多历史,所以我想要没有任何历史的克隆.

I wanted clone repository from github. It had lot of history, So i wanted clone without any history.

是否可以克隆没有历史记录的git存储库?

Is it possible to clone git repository without history?

您可以使用--depth选项获得值为1的浅表克隆

You can get a shallow clone using the --depth option with value 1

git clone --depth 1 reponame.git

如果您想要更多的提交历史记录,请根据需要增加值以满足您的需求.

If you want more commit history, increase the value to meet your needs as required.