这个这样的问题的后续:如果我有浅克隆,如何获取所有较旧的提交以使其成为完整克隆?
Follow-up of this so-question: if I have a shallow clone, how to fetch all older commits to make it a full clone?
下面的命令(git版本1.8.3)会将浅克隆转换为常规克隆
git fetch --unshallow
然后,访问origin上的所有分支(感谢评论中的@Peter)
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" git fetch origin
The below command (git version 1.8.3) will convert the shallow clone to regular one
Then, to get access to all the branches on origin (thanks @Peter in the comments)
编辑: git fetch --unshallow 现在是一个选项(感谢 Jack O'Connor)。
您可以
从浅层上的文档git fetch --depth=2147483647 >:
特殊深度 2147483647(或 0x7fffffff,有符号 32 位整数可以包含的最大正数)意味着无限深度。
EDIT: git fetch --unshallow now is an option (thanks Jack O'Connor).
You can run git fetch --depth=2147483647
git fetch --depth=2147483647
From the docs on shallow:
The special depth 2147483647 (or 0x7fffffff, the largest positive number a signed 32-bit integer can contain) means infinite depth.
我需要将存储库深化到特定的提交。
读完 man git-fetch 后,我发现不能指定提交,但可以指定日期:
man git-fetch
git fetch --shallow-since=15/11/2012
对于需要增量深化的人,再引述一下 man :
man
--deepen=<深度> 与--depth类似,不同之处在于它指定了深度的数量从当前浅边界而不是从尖端提交每个远程分支历史记录。
--deepen=<深度>
与--depth类似,不同之处在于它指定了深度的数量从当前浅边界而不是从尖端提交每个远程分支历史记录。
I needed to deepen a repo only down to a particular commit.
After reading man git-fetch, I found out that one cannot specify a commit, but can specify a date:
For those who need incremental deepening, another man quote:
--deepen=<depth> Similar to --depth, except it specifies the number ofcommits from the current shallow boundary instead of from the tipof each remote branch history.
--deepen=<depth>
Similar to --depth, except it specifies the number ofcommits from the current shallow boundary instead of from the tipof each remote branch history.
实现浅克隆到深克隆的两种方法。 :
使用以下步骤下载分支:(这将下载分支的浅表副本,然后将其转换为完整克隆,即带来完整的分支及其历史记录)。
a. git clone -b 分支 http://git.repository/customSP01.git --深度 1
这会执行浅克隆(带有深度选项)仅获取一个分支(在您请求的深度)。
b. cd customSP01 c. git fetch --depth=100 d. get fetch --depth=500 .... e. git fetch --unshallow
//上述命令会将浅克隆转换为常规克隆。然而,这并没有带来所有分支:
然后,访问所有分支。
f. git remote set-branches origin '*'
[此步骤也可以通过编辑 .git/config 中的以下行来手动完成。
fetch = +refs/heads/master:refs/remotes/origin/master
到(用 * 替换 master):
fetch = +refs/heads/*:refs/remotes/origin/*]
g. git fetch -v
这会将浅克隆转换为具有所有历史和分支详细信息的深克隆。
如果您使用以下命令而不是步骤 a 中的命令,则可以避免步骤 f 和 g。进行浅克隆:
git 克隆 -b 分支 --no-single-branch http://git.repository/customSP01.git< /a> --深度1
Two ways to achieve Shallow Clone to Deep Clone. :
Used the following steps to download the branch: (This downloads the shallow copy of the branch and then converts it into a Full Clone i.e bring complete branch and its history).
a. git clone -b branch http://git.repository/customSP01.git --depth 1
This does a shallow clone (with the depth-option) only fetches only one single branch (at your requested depth).
//The above command will convert the shallow clone to regular one.However, this doesn’t bring all the branches:
Then, to get access to all the branches.
[This Step can also be done manually by editing following line in .git/config.
to (replace master with *):
This converts the Shallow Clone into Deep Clone with all the History and Branch details.
You can avoid steps f and g, if you use the below instead of command present in step a. to do the shallow clone:
git clone -b branch --no-single-branch http://git.repository/customSP01.git --depth 1
你可以试试这个:
git fetch --update-shallow
You can try this:
上述消息都没有起到作用。我正在尝试从浅克隆开始使用 git 标签。
首先我尝试了
中途哪种方法有效。然而,没有可用的标签!
git fetch --depth=1000000
最后一个命令确实获取了标签,我终于可以执行
git checkout -b master-v1.1.0 tags/v1.1.0
并完成它了。
华泰
None of the above messages did the trick. I'm trying to work with git tags starting from a shallow clone.
First I tried
which kind of worked half-way through.Yet, no tags available!
This last command really fetched the tags and I could finally execute
and be done with it.
HTH
有助于解决该错误的配置是(在亚搏体育app实验室)对于每个项目:
在 .gitlab-ci-yml 中(这应该在调用 GitVersion.exe 的任何命令之前完成)
before_script: - git fetch --prune --tags --unshallow
Configurations that helped with the error is(In GitLab)For each project :
In the .gitlab-ci-yml (this should be done before any command that calls GitVersion.exe)
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(7)
下面的命令(git版本1.8.3)会将浅克隆转换为常规克隆
然后,访问origin上的所有分支(感谢评论中的@Peter)
The below command (git version 1.8.3) will convert the shallow clone to regular one
Then, to get access to all the branches on origin (thanks @Peter in the comments)
编辑:
git fetch --unshallow
现在是一个选项(感谢 Jack O'Connor)。您可以
从浅层上的文档git fetch --depth=2147483647 >:
EDIT:
git fetch --unshallow
now is an option (thanks Jack O'Connor).You can run
git fetch --depth=2147483647
From the docs on shallow:
我需要将存储库深化到特定的提交。
读完
man git-fetch
后,我发现不能指定提交,但可以指定日期:对于需要增量深化的人,再引述一下
man
:I needed to deepen a repo only down to a particular commit.
After reading
man git-fetch
, I found out that one cannot specify a commit, but can specify a date:For those who need incremental deepening, another
man
quote:实现浅克隆到深克隆的两种方法。 :
使用以下步骤下载分支:(这将下载分支的浅表副本,然后将其转换为完整克隆,即带来完整的分支及其历史记录)。
a. git clone -b 分支 http://git.repository/customSP01.git --深度 1
这会执行浅克隆(带有深度选项)仅获取一个分支(在您请求的深度)。
//上述命令会将浅克隆转换为常规克隆。
然而,这并没有带来所有分支:
然后,访问所有分支。
[此步骤也可以通过编辑 .git/config 中的以下行来手动完成。
fetch = +refs/heads/master:refs/remotes/origin/master
到(用 * 替换 master):
fetch = +refs/heads/*:refs/remotes/origin/*
]
这会将浅克隆转换为具有所有历史和分支详细信息的深克隆。
如果您使用以下命令而不是步骤 a 中的命令,则可以避免步骤 f 和 g。进行浅克隆:
git 克隆 -b 分支 --no-single-branch http://git.repository/customSP01.git< /a> --深度1
Two ways to achieve Shallow Clone to Deep Clone. :
Used the following steps to download the branch: (This downloads the shallow copy of the branch and then converts it into a Full Clone i.e bring complete branch and its history).
a. git clone -b branch http://git.repository/customSP01.git --depth 1
This does a shallow clone (with the depth-option) only fetches only one single branch (at your requested depth).
//The above command will convert the shallow clone to regular one.
However, this doesn’t bring all the branches:
Then, to get access to all the branches.
[This Step can also be done manually by editing following line in .git/config.
fetch = +refs/heads/master:refs/remotes/origin/master
to (replace master with *):
fetch = +refs/heads/*:refs/remotes/origin/*
]
This converts the Shallow Clone into Deep Clone with all the History and Branch details.
You can avoid steps f and g, if you use the below instead of command present in step a. to do the shallow clone:
git clone -b branch --no-single-branch http://git.repository/customSP01.git --depth 1
你可以试试这个:
You can try this:
上述消息都没有起到作用。我正在尝试从浅克隆开始使用 git 标签。
首先我尝试了
中途哪种方法有效。
然而,没有可用的标签!
最后一个命令确实获取了标签,我终于可以执行
并完成它了。
华泰
None of the above messages did the trick. I'm trying to work with git tags starting from a shallow clone.
First I tried
which kind of worked half-way through.
Yet, no tags available!
This last command really fetched the tags and I could finally execute
and be done with it.
HTH
有助于解决该错误的配置是
(在亚搏体育app实验室)
对于每个项目:
管道。
克隆,输入一个值,1000,GIT_DEPTH 的最大值阅读更多 - https://gitlab.yourcompany.com/help/ci/pipelines/settings#limit-the-number-of-changes-fetched-during-clone{}
在 .gitlab-ci-yml 中(这应该在调用 GitVersion.exe 的任何命令之前完成)
Configurations that helped with the error is
(In GitLab)
For each project :
pipelines.
clone, enter a value, 1000, the maximum value for GIT_DEPTH Read More - https://gitlab.yourcompany.com/help/ci/pipelines/settings#limit-the-number-of-changes-fetched-during-clone{}
In the .gitlab-ci-yml (this should be done before any command that calls GitVersion.exe)