捆绑 git 存储库而不克隆它

2023-12-28

如何捆绑 git 项目而不需要每次都克隆它?现在我总是执行下面的命令。

git clone --mirror http://git_project
cd git_project
git bundle create '../git_project.lock' --all
cd ..
rm git_project -Force -Recurse

我想用一个命令来完成此操作,例如:

git bundle create '../git_project.lock' --all --repository http://git_project

我将把这些捆绑文件作为另一台机器上的备份

自从我 2011 年的回答(十一年前)以来,你现在拥有像这样的远程管道GitHub 操作 https://github.com/features/actions or 亚搏体育appGitLab持续集成 https://docs.gitlab.com/ee/ci/.

这些远程 Git 存储库托管服务上的自动化管道可以为您创建捆绑包并将其保存到服务器/备份。

那就是今天。


明天,您将能够“git 捆绑包“-专用服务器,可通过捆绑包 URI.

在 Git 2.38(2022 年第 3 季度)中,“bundle URI”设计被记录下来。

See commit d06ed85 https://github.com/git/git/commit/d06ed85dcbfa3eaf083a5fa5324670d049117bea, commit 2da14fa https://github.com/git/git/commit/2da14fad8fe9889f067da2abe3b0763acae1f8f9 (09 Aug 2022) by Derrick Stolee (derrickstolee) https://github.com/derrickstolee.
(Merged by Junio C Hamano -- gitster -- https://github.com/gitster in commit 0d133a3 https://github.com/git/git/commit/0d133a3dcf43eb0396a5899008a4ff4ceaeb0d6e, 18 Aug 2022)

docs https://github.com/git/git/commit/2da14fad8fe9889f067da2abe3b0763acae1f8f9:文档包 URI 标准

Signed-off-by: Derrick Stolee

通过理想的设计文档将捆绑 URI 的想法引入 Git 代码库。
本文档包含完整的设计,旨在以完全实现的形式包含该功能。
这将采取实施计划部分详细介绍的几个步骤。

通过现在提交此文档,它可以用来激励实现这些最终目标所需的更改。
随着新信息的发现,设计仍然可以改变。

technical/bundle-uri现在包含在其man page https://github.com/git/git/blob/2da14fad8fe9889f067da2abe3b0763acae1f8f9/Documentation/technical/bundle-uri.txt#L1-L468:

捆绑 URI

Git 包是存储包文件以及一些额外元数据的文件, 包括一组引用和一组(可能为空)必要的提交。看git bundle https://git-scm.com/docs/git-bundle和链接:bundle-format.txt[捆绑格式]了解更多信息 信息。

捆绑包 URI 是 Git 可以下载一个或多个捆绑包的位置 为了在获取剩余的数据之前引导对象数据库 来自远程的对象。

目标之一是加快网络状况较差的用户的克隆和获取速度 与源服务器的连接。另一个好处是允许重度用户, 例如 CI 构建农场,将本地资源用于大部分 Git 数据 从而减轻源服务器的负载。

要启用捆绑包 URI 功能,用户可以使用以下命令指定捆绑包 URI 命令行选项或源服务器可以通告一个或多个 URI 通过协议 v2 功能。

See Also

  • 捆绑 URI 功能的早期 RFC https://lore.kernel.org/git/RFC-cover-00.13-0000000000-20210805T150534Z-avarab@gmail.com/.

  • The GVFS协议 https://github.com/microsoft/VFSForGit/blob/master/Protocol.md

And:

bundle-uri https://github.com/git/git/commit/d06ed85dcbfa3eaf083a5fa5324670d049117bea:添加示例包组织

Signed-off-by: Derrick Stolee

添加一个部分,详细说明捆绑包提供程序如何工作,包括对多个地理分布式服务器使用 Git 服务器广告。
该组织基于 GVFS 缓存服务器,该服务器已成功地使用类似的想法为非常大的存储库提供快速对象访问并减少服务器负载。

technical/bundle-uri现在包含在其man page https://github.com/git/git/blob/d06ed85dcbfa3eaf083a5fa5324670d049117bea/Documentation/technical/bundle-uri.txt#L352-L456:

捆绑包提供商组织示例

此示例组织是所使用内容的简化模型 GVFS 缓存服务器(请参阅本文档末尾附近的部分) 有利于加速非常大的克隆和获取 存储库,尽管使用 Git 之外的额外软件。

捆绑包提供商跨多个地理位置部署服务器。
每个服务器管理自己的捆绑包集。

服务器可以跟踪多个 Git 存储库,但根据模式为每个存储库提供捆绑列表。

例如,当镜像存储库时https://<domain>/<org>/<repo>捆绑包服务器可以在以下位置获取其捆绑包列表:https://<server-url>/<domain>/<org>/<repo>.
源Git服务器可以 在“任意”模式下列出所有这些服务器:

[bundle]
version = 1
mode = any

[bundle "eastus"]
uri = https://eastus.example.com/<domain>/<org>/<repo>

[bundle "europe"]
uri = https://europe.example.com/<domain>/<org>/<repo>

[bundle "apac"]
uri = https://apac.example.com/<domain>/<org>/<repo>

这个“列表的列表”是静态的,并且仅当捆绑服务器处于活动状态时才会改变。 添加或删除。

捆绑包服务器定期运行捆绑包列表更新, 比如每天一次。
在此任务期间,服务器会获取最新的 来自原始服务器的内容并生成包含以下内容的包 可从最新的原始引用访问的对象,但不包含在 先前计算的包。
此捆绑包已添加到列表中,请小心 认为creationToken严格大于先前的最大值creationToken.

这里提供了一个示例捆绑列表,尽管它每天只有两个 捆绑包,而非 30 个完整列表:

[bundle]
version = 1
mode = all
heuristic = creationToken

[bundle "2022-02-13-1644770820-daily"]
uri = https://eastus.example.com/<domain>/<org>/<repo>/2022-02-09-1644770820-daily.bundle
creationToken = 1644770820

[bundle "2022-02-09-1644442601-daily"]
uri = https://eastus.example.com/<domain>/<org>/<repo>/2022-02-09-1644442601-daily.bundle
creationToken = 1644442601

[bundle "2022-02-02-1643842562"]
uri = https://eastus.example.com/<domain>/<org>/<repo>/2022-02-02-1643842562.bundle
creationToken = 1643842562

这种数据组织的意图有两个主要目标。

  • 一、初始 通过下载预先计算的对象,存储库的克隆变得更快 来自更近的来源的数据。

  • Second, git fetch命令可以更快, 特别是如果客户已经好几天没有取货了。然而,如果一个 客户端在 30 天内没有获取数据,那么捆绑列表组织将 导致重新下载大量对象数据。


This is implemented (still with Git 2.38 (Q3 2022)): "git clone --bundle-uri https://github.com/git/git/blob/68ef0425d99cafb08f4c33eaa558505068fe2143/Documentation/git-clone.txt"(man https://git-scm.com/docs/git-clone).

See commit 65da938 https://github.com/git/git/commit/65da93891680edc0d1471d436d92d4da7d0b4465 (23 Aug 2022), and commit e21e663 https://github.com/git/git/commit/e21e663cd1942df29979d3e01f7eacb532727bb7, commit 59c1752 https://github.com/git/git/commit/59c1752ab6768cb9c380f0a7c9d06af79d183f67, commit 5556891 https://github.com/git/git/commit/55568919616429fbc209880cf189a3adaceb6093, commit 53a5089 https://github.com/git/git/commit/53a50892be20a91fb0dcf572a641ce2a79af1a38, commit b5624a4 https://github.com/git/git/commit/b5624a44744d6e5f9c749e4df02932c724e2097e (09 Aug 2022) by Derrick Stolee (derrickstolee) https://github.com/derrickstolee.
(Merged by Junio C Hamano -- gitster -- https://github.com/gitster in commit 68ef042 https://github.com/git/git/commit/68ef0425d99cafb08f4c33eaa558505068fe2143, 01 Sep 2022)

clone https://github.com/git/git/commit/55568919616429fbc209880cf189a3adaceb6093: 添加 --bundle-uri 选项

Reviewed-by: Josh Steadmon
Signed-off-by: Derrick Stolee

克隆远程存储库是 Git 中最昂贵的操作之一。
服务器可能会花费大量的 CPU 时间来为客户端的请求生成包文件。
数据量大会导致网络长时间堵塞,而且Git协议不可恢复。
对于网络连接较差或距离源服务器较远的用户来说,这可能尤其痛苦。

Add a new '--bundle-uri' option to 'git clone https://github.com/git/git/blob/55568919616429fbc209880cf189a3adaceb6093/Documentation/git-clone.txt'(man https://git-scm.com/docs/git-clone) to bootstrap a clone from a bundle.
If the user is aware of a bundle server, then they can tell Git to bootstrap the new repository with these bundles before fetching the remaining objects from the origin server.

git clone现在包含在其man page https://github.com/git/git/blob/55568919616429fbc209880cf189a3adaceb6093/Documentation/git-clone.txt#L326-L331:

--bundle-uri=<uri>

在从远程获取之前,从给定的位置获取包<uri>并将数据解绑到本地存储库中。

裁判们 捆绑包中将存储在隐藏下refs/bundle/*命名空间。

此选项不兼容--depth, --shallow-since, and --shallow-exclude


Git 2.39(2022 年第 4 季度)定义了“bundle list”、将它们存储在核心中的数据结构、传输它们的格式以及解析它们的代码。

See commit 8628a84 https://github.com/git/git/commit/8628a842bddda7723ad7548b7f6d141123a164a0, commit 70334fc https://github.com/git/git/commit/70334fc3ebf1c6199014d82bbbf0595b64a8fa90, commit 89bd7fe https://github.com/git/git/commit/89bd7fedf947484da08e2722d663fdac23a431be, commit c23f592 https://github.com/git/git/commit/c23f592117bac30765ca22545386c3e9304da803, commit c96060b https://github.com/git/git/commit/c96060b0cef79c9d76eb97965e700beb9651f35b, commit 20c1e2a https://github.com/git/git/commit/20c1e2a68bfcb85dd919c92a82c129cee215c23a, commit 738e524 https://github.com/git/git/commit/738e5245fa423fc43495e2e17e053365dc6b2fc0, commit bff03c4 https://github.com/git/git/commit/bff03c47f7342c2a08fac6c0af7229b1579fea15, commit 0634f71 https://github.com/git/git/commit/0634f717a3e3c57ee5d965882366df1ada1ad11b, commit 23b6d00 https://github.com/git/git/commit/23b6d00ba7fd4b3446319395cfe3791710e81d92 (12 Oct 2022) by Derrick Stolee (derrickstolee) https://github.com/derrickstolee.
See commit d796ced https://github.com/git/git/commit/d796cedbe8ca77310a7dabcafe60b040aa0e2b67, commit 9424e37 https://github.com/git/git/commit/9424e373fd2136aa7f5cec23c8cafc272996ecd6 (12 Oct 2022) by Ævar Arnfjörð Bjarmason (avar) https://github.com/avar.
See commit f677f62 https://github.com/git/git/commit/f677f62970eed0f4b1a9075bcaf3f9f64027f30e (24 Aug 2022) by Junio C Hamano (gitster) https://github.com/gitster.
(Merged by Taylor Blau -- ttaylorr -- https://github.com/ttaylorr in commit d32dd8a https://github.com/git/git/commit/d32dd8add53120cef9b30be4240010c2ab6bfc6f, 30 Oct 2022)

bundle-uri https://github.com/git/git/commit/c23f592117bac30765ca22545386c3e9304da803:获取捆绑包列表

Signed-off-by: Derrick Stolee

当给定捆绑包 URI 中的内容不被理解为捆绑包(基于检查初始内容)时,Git 目前会放弃并忽略该内容。
独立的捆绑包提供商可能希望将捆绑包内容拆分为多个捆绑包,但仍可通过单个 URI 获取它们。

教 Git 尝试将包 URI 内容解析为 Git 配置文件,提供key=value对作为捆绑列表。
然后,Git 查看列表的模式,看看是否有任何单个包就足够了,或者是否需要所有包。
下载所选 URI 处的内容并再次检查内容,从而创建递归过程。

为了防止递归出现格式错误或恶意内容,暂时将递归深度限制为合理的四。
如果需要,可以在将来将其转换为配置值。
四的值是预期有用的两倍(捆绑列表不太可能指向更多捆绑列表)。

要测试此场景,请创建一个有趣的捆绑包拓扑,其中三个增量捆绑包构建在单个完整捆绑包之上。
通过使用合并提交,两个中间捆绑包是“独立的”,因为它们不需要彼此来解绑自己。
他们每个人只需要基础包。
不过,包含合并提交的包需要两个中间包。
这会导致在分拆时做出一些有趣的决定,特别是当我们稍后实施启发式方法来促进下载捆绑包直到满足先决条件提交时。


Git 2.40(2023 年第 1 季度)继续实施捆绑 URI(第 4 部分)。

See commit 876094a https://github.com/git/git/commit/876094ac16870727207e6afc0b26060101a52359, commit 12b0a14 https://github.com/git/git/commit/12b0a14b9e5f140a9a4d5a3e3c47fae00a53c6fc, commit ebc3947 https://github.com/git/git/commit/ebc39479558fb4893c72a35065e6792515acef86, commit 9ea5796 https://github.com/git/git/commit/9ea57964953dec11dcbbd5d4bf44a5e3781f5880, commit 738dc7d https://github.com/git/git/commit/738dc7d4a5f42376bc748008dd8792aa4eb25627, commit 1b759e0 https://github.com/git/git/commit/1b759e0cf1c18c637e40c6c191a0b614e4e4ea43 (22 Dec 2022) by Derrick Stolee (derrickstolee) https://github.com/derrickstolee.
See commit 70b9c10 https://github.com/git/git/commit/70b9c1037325ee82bc0832f4ca2d30c6ebf4808e, commit 7cce907 https://github.com/git/git/commit/7cce9074a728fb32501054577963d8ae31d007be, commit 0cfde74 https://github.com/git/git/commit/0cfde740f0b2c9474aae3a381d1d6e97c7468e7a, commit 8f788eb https://github.com/git/git/commit/8f788eb8b75502acb5c7d771279e486bae626dde, commit 8b8d9a2 https://github.com/git/git/commit/8b8d9a229888adb737851c4d7eeaa9a50e37afe1 (22 Dec 2022) by Ævar Arnfjörð Bjarmason (avar) https://github.com/avar.
(Merged by Junio C Hamano -- gitster -- https://github.com/gitster in commit 0903d8b https://github.com/git/git/commit/0903d8bbdef6c2607f2e0bf43a4d10cf54b03744, 02 Jan 2023)

bundle-uri client https://github.com/git/git/commit/7cce9074a728fb32501054577963d8ae31d007be:添加布尔值transfer.bundleURI setting

Co-authored-by: Derrick Stolee
Signed-off-by: Ævar Arnfjörð Bjarmason
Signed-off-by: Derrick Stolee

尚未引入的对bundle-uri 的客户端支持将始终依赖于完整克隆,但我们仍然希望能够完全忽略服务器的bundle-uri 广告。

The new transfer.bundleURI配置选项默认为“false”,但用户可以将其设置为“true”以启用使用协议 v2 检查来自源 Git 服务器的捆绑包 URI。

git config现在包含在其man page https://github.com/git/git/blob/7cce9074a728fb32501054577963d8ae31d007be/Documentation/config/transfer.txt#L118-L123:

transfer.bundleURI

When true, local git clone命令将请求捆绑包 来自远程服务器的信息(如果公布)并下载 包,然后通过 Git 协议继续克隆。
默认为false.

And:

bundle-uri https://github.com/git/git/commit/738dc7d4a5f42376bc748008dd8792aa4eb25627: serve bundle.* keys从配置

Signed-off-by: Derrick Stolee

通过填充来实现“bundle-uri”协议 v2 功能key=value来自本地 Git 配置的数据包行。
捆绑包列表由以“bundle.”开头的键提供。

And:

bundle-uri https://github.com/git/git/commit/ebc39479558fb4893c72a35065e6792515acef86: 允许捆绑列表中的相对 URL

Signed-off-by: Derrick Stolee

捆绑包提供商可能希望跨多个 CDN 分发该数据。
这可能需要更改基本 URI,一直到域名。
如果所有包都需要在其 'uri' 值,那么每次推送到 CDN 都需要更改目录以匹配预期的域和其中的确切位置。

允许捆绑包列表指定捆绑包的相对 URI.

此 URI 基于客户端接收捆绑列表的位置。
对于“bundle-uri”协议 v2 命令中提供的列表,Git 远程 URI 是基本 URI。
否则,捆绑包列表是从不使用 Git 协议的 HTTP URI 提供的,并且该 URI 是基本 URI。
这使得捆绑数据的分发更加容易。


在 Git 2.40(2023 年第一季度)中,bundle-URI 子系统添加了对创建令牌启发式的支持,以帮助增量获取。

See commit 026df9e https://github.com/git/git/commit/026df9e04789e2af7271566f312aae323740309f, commit c429bed https://github.com/git/git/commit/c429bed10223135a13f1f2f854e367762c37af7a, commit 7f0cc04 https://github.com/git/git/commit/7f0cc04f2ca1653d573dbe981090895dc959ce65, commit 0524ad3 https://github.com/git/git/commit/0524ad3542c48c759366bc49dbd8bed4cc94dc79, commit 4074d3c https://github.com/git/git/commit/4074d3c7e1a3b44c5c02235799d798f8b2613333, commit 7903efb https://github.com/git/git/commit/7903efb7170ca9704e80ef9188bef37ecf55f2d6, commit 512fccf https://github.com/git/git/commit/512fccf8a503bd8617fe46cb62c77480b83fbaea, commit c93c3d2 https://github.com/git/git/commit/c93c3d2fa42bec64948441cb339d78e2044ff9a3, commit 7bc73e7 https://github.com/git/git/commit/7bc73e7b61e60cbc0730a4f0e938c482c459e000, commit d9fd674 https://github.com/git/git/commit/d9fd674c8b26c376b37e02d974b92033acb99732, commit e72171f https://github.com/git/git/commit/e72171f085e48ed9292809815bf70b6e685b73c6 (31 Jan 2023) by Derrick Stolee (derrickstolee) https://github.com/derrickstolee.
(Merged by Junio C Hamano -- gitster -- https://github.com/gitster in commit 4f59836 https://github.com/git/git/commit/4f598364519f5bb871caf12a482ed117a270588b, 15 Feb 2023)

clone https://github.com/git/git/commit/4074d3c7e1a3b44c5c02235799d798f8b2613333:如果合适的话设置 fetch.bundleURI

Signed-off-by: Derrick Stolee

捆绑包提供商可能会以旨在改进增量获取(而不仅仅是初始克隆)的方式组织其捆绑包列表。
然而,他们确实需要声明他们已经考虑到这一点进行组织,否则客户将不会期望通过在初始克隆后下载捆绑包来节省时间。
这是通过指定bundle.heuristic 值来完成的。

有两种类型的捆绑列表:静态 URI 上的捆绑列表和通过协议 v2 从 Git 远程发布的捆绑列表。

The new fetch.bundleURI config value applies for static bundle URIs that are not advertised over protocol v2.
If the user specifies a static URI via 'git clone --bundle-uri https://github.com/git/git/blob/4074d3c7e1a3b44c5c02235799d798f8b2613333/Documentation/git-clone.txt#L326'(man https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---bundle-urilturigt), then Git can set this config as a reminder for future 'git fetch https://github.com/git/git/blob/4074d3c7e1a3b44c5c02235799d798f8b2613333/Documentation/git-fetch.txt'(man https://git-scm.com/docs/git-fetch) operations to check the bundle list before connecting to the remote(s).

对于通过协议 v2 提供的列表,我们将希望采取不同的方法并通过创建remote.<id>.*键入配置键。
在此更改中并未实现这一点。

稍后更改将更新'git fetch' 使用此选项。

git config现在包含在其man page https://github.com/git/git/blob/4074d3c7e1a3b44c5c02235799d798f8b2613333/Documentation/config/fetch.txt#L99-L106:

fetch.bundleURI

该值存储用于从包下载 Git 对象数据的 URI 从源 Git 服务器执行增量获取之前的 URI。

这类似于--bundle-uri选项的行为在git clone https://git-scm.com/docs/git-clone.
git clone --bundle-uri将设置fetch.bundleURI如果提供的捆绑包 URI 包含捆绑包,则该值 为增量获取而组织的列表。


"git fetch --all https://github.com/git/git/blob/89833fc249189d5b91509b1b3f16b26aade9e7f7/Documentation/git-fetch.txt"(man https://git-scm.com/docs/git-fetch) does not have to download and handle the same bundleURI over and over, which has been corrected with Git 2.41 (Q2 2023).

See commit 25bccb4 https://github.com/git/git/commit/25bccb4b79dce1d5c259228ef3c91eadcd13d8ac (31 Mar 2023) by Derrick Stolee (derrickstolee) https://github.com/derrickstolee.
(Merged by Junio C Hamano -- gitster -- https://github.com/gitster in commit 89833fc https://github.com/git/git/commit/89833fc249189d5b91509b1b3f16b26aade9e7f7, 06 Apr 2023)

fetch https://github.com/git/git/commit/25bccb4b79dce1d5c259228ef3c91eadcd13d8ac:下载一次捆绑包,即使使用--all

Signed-off-by: Derrick Stolee

When fetch.bundleURI is set, 'git fetch https://github.com/git/git/blob/25bccb4b79dce1d5c259228ef3c91eadcd13d8ac/Documentation/git-fetch.txt'(man https://git-scm.com/docs/git-fetch) downloads bundles from the given bundle URI before fetching from the specified remote.
However, when using non-file remotes, 'git fetch --all' will launch 'git fetch' subprocesses which then read fetch.bundleURI and fetch the bundle list again.
We do not expect the bundle list to have new information during these multiple runs, so avoid these extra calls by un-setting fetch.bundleURI in the subprocess arguments.

请小心跳过获取空捆绑字符串的捆绑。
从空列表中获取包会出现一些有趣的测试失败。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

捆绑 git 存储库而不克隆它 的相关文章

  • git reset 命令中的 ~1 是什么意思?

    git 重置 HEAD 1 我的印象是 1 的意思是 从 HEAD 开始 遵循 1 链接 并将 HEAD 标签设置为新的提交节点 我正期待着 git 重置 HEAD 2 跟随 2 个链接 然后设置 HEAD 标签 但是 如果我尝试它 我会收
  • 在 Windows 7 上的 Sourcetree 中比较 Word docx 文件

    我一直在尝试获取在 Windows 7 上的 Sourcetree 中工作的 Word docx 文件的文本差异 我已按照此处的说明进行操作将 Microsoft Word 与 git 结合使用 http blog martinfenner
  • 使用终端时 Git 推送在总计后卡住了?

    我尝试将一些文件推送到Github 总大小只有22 2M 我不知道为什么它在总行之后卡住了 我读过推送到 Github 时 Git 推送挂起 https stackoverflow com questions 16906161 git pu
  • Netbeans 和 Git,.obj 文件被忽略

    我正在开发一个涉及 obj 文件的小型 git 项目 当我查看 项目选项卡 时 我发现它们被忽略了 但如果我查看我的 gitignore 我无法理解为什么 DepthPeeling nbproject private DepthPeelin
  • `git Reset HEAD file` 是否也检查该文件?

    我错误地向 git 添加了一个目录 当我按照提示操作时here https stackoverflow com questions 348170 undo git add通过执行以下操作来撤消添加git reset HEAD
  • 当 .gitattributes 中的 EOL 设置为 CRLF 时,Git diff 认为行结尾为 LF

    当我恢复对带有 Windows 行结尾的文件的更改并且 gitattributes 将 EOL 定义为 CRLF 时 git 认为行结尾已更改为 LR 即使十六进制编辑器显示 CRLF 仅当 gitattributes 定义 EOL 字符时
  • Git 将一个分支合并到所有其他分支中

    我知道这个问题已经在这里被问过 https stackoverflow com questions 2329716 merging changes from master into all branches using git https
  • 创建一个空分支?

    我有一个包含项目的 git 存储库 我现在要对这个项目进行大规模的修改 如何为这次大修创建一个空白的新分支 然后当完成时 如何将这个分支切换到master 使用 checkout orphan 命令 git checkout orphan
  • 如何使用 Git 跟踪目录而不是文件?

    我最近开始使用 Git 但只有一件事遇到了麻烦 如何在不跟踪目录内容的情况下跟踪目录 例如 我正在开发的网站允许上传 我想跟踪上传目录 以便在分支等时创建它 但显然不是其中的文件 在开发分支中的测试文件或主控中的真实文件 在我的 gitig
  • Git 2.2.x 无缘无故更新旧包文件的时间戳

    Git 2 2 0 和 2 2 1 似乎修改了旧的时间戳 git objects pack pack pack偶尔会无缘无故地文件 它只是改变时间戳 内容是相同的 调试这一点很困难 因为它似乎很少进行更改 我在 2 2 0 之前的任何 Gi
  • 自定义 SSH 端口上的 Git

    我的 VPS 提供商建议我将 SSH 端口保留为他们默认分配的自定义端口号 不是 22 问题是 虽然我知道我可以在创建远程配置时提供端口号 但在进行 Git 克隆时似乎无法提供相同的操作 我在用gitolite https wiki arc
  • Android 存储库初始化失败

    我想我非常仔细地遵循该网站的说明 http source android com source downloading html http source android com source downloading html 但是当我尝试这
  • git 排除与忽略

    I use Tower http www git tower com 用于在 Mac 中使用 Git Tower 中的设置具有创建 gitignore 的 忽略 部分 但它还有另一个名为 排除 的部分 似乎可以将排除与 git ls fil
  • Git 更改丢失 - 为什么?

    我们的开发团队正在使用 git 最近我们至少两次丢失了文件更改 我们正在使用私人 Github 存储库 在当前情况下 我们可以返回 Github 上的日志并查看我对文件所做的一些更新 后来 另一位团队成员更改了文件的不同部分 它似乎破坏了我
  • 如何减少 Bitbucket 上的 git repo 大小?

    我的问题摘要 在我向两个现有文件添加了几百个字节后 我在 Bitbucket 上的一个私人存储库的大小突然增加了一倍多 该存储库现在超过 2GB 这导致 Bitbucket 将其置于只读模式 因为它处于只读模式 所以我无法推送会减少存储库大
  • git 2.32 git push -u origin master 没有任何反应

    I ve starting to use git github and I m stucked on how to push my codes to github I m following some tutorials and when
  • VSTS:在构建过期的情况下自动变基/合并和重新排队构建验证门

    我们最近对 PR 上的构建验证门进行了更改 这样 如果另一个提交在当前 PR 完成之前进入主分支 则构建会 立即 过期 看here https stackoverflow com questions 49418800 vsts invali
  • git 推送到 github 失败并显示“错误:pack-objects 因信号 967 死亡”

    我触发了这个命令 git push origin master 我得到这个结果 Counting objects 15626 done Delta compression using up to 4 threads error pack o
  • 我应该把 .gitignore 放在哪里才能影响所有项目?

    我应该在哪里放置一个 gitignore文件以便我的所有项目都使用这些设置 我尝试了各种文件夹 只有将其放入项目文件夹中才能使其正常工作 但是设置 当然 仅应用于该项目 而不是我的其他项目 git 包含一个 全局 配置选项 可以告诉它在启动
  • 如何使用 git 比较不​​在存储库中的两个文件

    我想比较两个不在任何 git 存储库中的 css 文件 git中有这样的功能吗 git的 diff 比标准 Unix 更实用diff 我经常想这样做 并且由于这个问题在谷歌上排名很高 所以我希望这个答案出现 这个问题 如何使用git dif

随机推荐

  • 如何让三星智能电视模拟器查看我的应用程序?

    我刚刚开始开发三星智能电视 到目前为止 我的第一步是一个巨大的失败 我正在运行 Linux 并且因为我已经安装并配置了 Eclipse 以进行 Android 开发 所以我尚未成功安装和运行智能电视 SDK 然而 受到鼓励如何在没有 IDE
  • gwt 中的 Window.alert() 事件

    我有一个疑问 如果我们在 gwt 的 Window alert 中按 OK 按钮会发生什么 如果我们按下 确定 按钮 背面是否会发生任何事件 Window alert 是一个阻塞调用 所以点击后OK代码恢复运行 Window alert O
  • 在 WiX 3.6 中设置 WebSite 元素的 AppPool

    我有一个 WiX 安装程序 它设置了几个根 IIS 网站 每个网站都有许多 Web 应用程序 我们为每个根都有一个单独的应用程序池 并将每个 Web 应用程序放入该应用程序池中 不幸的是 我找不到一种方法来确保网站进入其所需的应用程序池 而
  • 管理手动 URL 导航上的用户身份验证状态

    我将 Angular2 与 ASP NET Core MVC 结合使用 并且管理手动 URL 导航工作正常 服务器正在使用 Angular2 成功加载我的主页视图 在用户身份验证上 我设置一个会话变量 如下所示 HttpHelper Htt
  • 在VS2005上使用“--layout=system”时Boost链接错误

    我是 boost 新手 我想尝试一下 dll 的一些实际部署场景 因此我使用以下命令来编译 安装库 bjam install layout system variant debug runtime link shared link shar
  • 设置子进程中共享 c_char_p 中字符串的值?

    我有这样的情况 主进程生成一些子进程 它们应该将结果写入字符串和数字类型的共享对象中 对于数字类型没有问题 但对于字符串 值将丢失 import multiprocessing as mp from ctypes import Struct
  • 如何获取项目中所有功能的列表?

    我想以编程方式提取 Google Apps 项目中所有功能的列表 任何服务中似乎都没有一种方法可以轻松提取它们 除非它似乎以某种方式存储在 this 函数中 最好的方法是什么 您想要检索函数列表 您希望使用 Google Apps 脚本来实
  • scipy 成对距离和 X.X+Y.Y - X.Y^t 之间的差异

    假设我们的数据为 d1 np random uniform low 0 high 2 size 3 2 d2 np random uniform low 3 high 5 size 3 2 X np vstack d1 d2 X array
  • “.T”对于 Numpy 数组意味着什么?

    我在 SciPy 文档中看到了这个例子 x y np random multivariate normal mean cov 5000 T 最后的 T 实际上在这里做什么 The T访问属性T对象的 它恰好是一个 NumPy 数组 这T属性
  • 多个新元素的角度交错动画

    我正在尝试在列表中添加交错动画 到目前为止 我已经成功地加载了交错动画 除了加载之外 我还希望在将新项目添加到数组时触发交错动画 我按照这个例子 https medium com google developer experts angul
  • InnoSetup:如何在组件描述中添加换行符

    我正在尝试在组件的描述中间添加换行符 但我似乎找不到合适的语法 Components Name Component A Description This is component A NewLine My component A has t
  • matlab函数sum()的奇怪行为

    知道为什么 Matlab 会这样吗 gt gt sum 0 0 0 Subscript indices must either be real positive integers or logicals gt gt sum 1 1 1 an
  • Xcode Interface Builder - 删除/重命名错误接线的 IBOutlets / IBActions 的“正确”方法?

    我是 Xcode 新手 使用 Swift 工作 所以我不确定我所描述的是否实际上是一个错误 使用界面生成器和助理编辑器时 我可以创建标签 按钮等 并通过按住 Control 键拖动在代码中创建 Outlet 和 Action 只要我是完美的
  • Drools:在数据库中存储规则

    目前 我将所有规则文件存储在文件系统上 它们有很多版本 并在启动时将它们的不同版本加载到内存中 我想更改为将我的 drools 文件存储在数据库中 并且想知道 Drools 是否有任何解决方案或插件可以促进这一点 或者我应该自己制作 Tha
  • 如何在没有 JavaScript 的情况下仅使用内联 CSS 创建工具提示?

    我正在尝试使用内联 CSS 创建悬停工具提示 而不使用 JavaScript 这是我现在的代码 a href hover text span style background color black color white span a
  • 以 JSON 形式提交表单(无 AJAX)

    是否可以在不使用 AJAX 的情况下以 JSON 形式提交表单数据 我尝试更改 enctype
  • Youtube API 返回当前时间

    我正在使用 youtube iframe api 似乎无法在文档或 google 上找到任何引用如何获取当前媒体完成时的返回值的内容 我需要构建一个脚本 可以在其中传递时间变量 其中当变量与当前播放时间匹配时可以触发事件 我知道在嵌入 AP
  • 如何在 R 中导出/导入向量?

    我意识到这是一个非常基本的问题 但我想确保我做得正确 所以我想问只是为了确认 我在一个项目中有一个向量 我希望能够在另一个项目中使用它 我想知道是否有一种简单的方法可以以一种可以轻松将其导入到另一个项目的形式导出该向量 到目前为止 我想出的
  • 从 jquery 通过 AJAX 发送图像数据

    我需要使用 AJAX 将图像数据 data image png base64 从客户端发送到我的 PHP 服务器 我的 AJAX 调用如下所示 表单数据包含图像 ajax url global siteurl save image data
  • 捆绑 git 存储库而不克隆它

    如何捆绑 git 项目而不需要每次都克隆它 现在我总是执行下面的命令 git clone mirror http git project cd git project git bundle create git project lock a