gpt4 book ai didi

git - Azure DevOps : how to squash all commits of a PR as a patch to download for test?

转载 作者:行者123 更新时间:2023-12-03 05:34:54 25 4
gpt4 key购买 nike

我正在研究 Azure DevOps

我有一个从分支 A 到分支 B 的 PR( pull 请求),其中包含 100 多个提交。现在,当我将它 merge 到分支 B 时,PR 构建会抛出错误。

现在,我尝试理解为什么构建会失败。我想将此 PR 中的所有提交下载为 .patch 文件,以便我可以将其应用到本地存储库(在分支 B 上)并构建它并了解构建中断的原因。

Azure DevOps 上有没有办法从 PR 下载补丁?

我知道在 github 中,我们可以通过在 PR 的 URL 中添加“.patch”来轻松做到这一点,如下所示:https://github.com/AAA/BBB/pull/123456.patch 是 PR 的更改补丁:https://github.com/AAA/BBB/pull/123456

最佳答案

恐怕azure devops没有像在github中那样下载补丁文件的功能。

作为解决方法,您可以首先将 azure 存储库克隆到本地计算机,然后使用 git format-patch 命令获取补丁文件。

例如,我有一个从分支工作到 azure devops 存储库中的 master 的 PR。

参见下面的示例:

git clone https://<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cca3beab8ca8a9bae2adb6b9bea9e2afa3a1" rel="noreferrer noopener nofollow">[email protected]</a>/org/proj/_git/repo
git checkout working
git pull
git format-patch master --stdout > ./workingtomaster.patch

首先,我将 azure devops 存储库克隆到本地计算机,并 checkout 工作分支,然后使用 git format-patch 命令输出补丁文件。 PR 中所有即将 merge 到 master 分支的提交都将导出到路径文件中。

但是您也可以submit a feature request致微软开发团队,希望他们在未来的冲刺中考虑实现此功能。

关于git - Azure DevOps : how to squash all commits of a PR as a patch to download for test?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63239342/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com