在不了解整个历史的情况下致力于 git



我们有一个相当大的 git 存储库,我们会自动提交到它。

是否可以在不先下载孔历史记录的情况下提交到 git 存储库?
在我看来应该是,因为当前的提交只是引用了最后一个,但我不知道如何。

是的,你可以做到。

# clone specific branch and only latest commit 
# This will only download a single branch and you will not be able to 
# see other branches
git clone <url> --branch=<branch> --depth=1

Git 克隆选项:

-b / --branch

下载特定的分支
--branch也可以在该提交时获取标签分离 HEAD在生成的存储库中。

<小时 />

--depth

要下载的提交(最新(数.
创建一个浅表克隆,其历史记录被截断为指定的提交数。

<小时 />

--shallow-since=<date>

创建具有指定时间后历史记录的浅表克隆。

您还可以查看任何过去的提交表单历史记录,而不仅仅是最新的

相关内容

最新更新