简体   繁体   English

采摘樱桃后的 Azure DevOps 拉取请求

[英]Azure DevOps Pull Request after Cherry Picking

I'm working with Azure DevOps and running into a situation with git and a Pull Request I can't understand and looking for help.我正在使用 Azure DevOps,遇到了 git 和 Pull Request 的情况,我无法理解并寻求帮助。

Here is the scenario:这是场景:

  • I have two branches: dev, stage.我有两个分支:dev、stage。
  • dev has numerous commits which have not been merged into stage. dev 有许多未合并到 stage 中的提交。
  • file.txt exists in both branches; file.txt 存在于两个分支中; there are three commits (123,124,125) in dev which have mutated this file so it is content wise different than stage. dev 中有三个提交(123,124,125)已经改变了这个文件,所以它在内容上与 stage 不同。

I cherry pick commit 123 from dev with a target branch of stage into a topic branch.我从 dev 中挑选 commit 123,将 stage 的目标分支转换为主题分支。 The topic branch is then pull requested into stage.然后将主题分支请求拉入阶段。

I then repeat this process for commit 124 and 125 from dev.然后我对来自 dev 的提交 124 和 125 重复此过程。

If I compare file.txt in the dev branch to file.txt in the stage branch they are now identical content wise.如果我将 dev 分支中的 file.txt 与 stage 分支中的 file.txt 进行比较,它们现在是相同的内容。

If I submit a pull request in Azure DevOps from dev to stage on the Files tab of the pull request it is showing me the proposed changes to file.txt as if the dev commits had never been cherry picked into the stage version of file.txt.如果我在拉取请求的“文件”选项卡上从开发人员到阶段提交 Azure DevOps 中的拉取请求,它会向我显示对 file.txt 的建议更改,就好像开发提交从未被选入 file.txt 的阶段版本一样.

I realize that when I cherry pick, a new commit is created within stage so the stage branch does not realize commits 123,124,125 from dev have been applied -- but shouldn't the Azure DevOps File view know the content of file.txt is the same?我意识到当我选择时,会在 stage 内创建一个新的提交,因此 stage 分支没有意识到来自 dev 的提交 123,124,125 已被应用——但 Azure DevOps File 视图不应该知道 file.txt 的内容是相同的?

That happens because the diff that you see there is not between the source branch and the target branch.发生这种情况是因为您看到的差异不在源分支和目标分支之间。 The diff is between the source branch and the point where the source branch and the target branch diverged ..... so, you might have modified the file in the target branch in subsequent revisions after the branches diverged.差异在源分支与源分支和目标分支分歧的点之间......因此,您可能在分支分歧后的后续修订中修改了目标分支中的文件。 It doesn't matter, the diff in the PR in azure devops (well, at least that's the sane way it works in github and gitlab) doesn't care about them.没关系,azure devops 中 PR 中的差异(好吧,至少这是它在 github 和 gitlab 中的正常工作方式)并不关心它们。

Tip: think of it as a diff not done git diff target source but rather git diff target...source (with 3 dots)... and it is done like that because if you did it with a default diff, the diff of the work in a PR would be a moving target.提示:把它想象成一个 diff 没有完成git diff target source而是git diff target...source (with 3 dots)... 这样做是因为如果你用默认的 diff 做它,diff PR 中的工作将是一个移动的目标。 It would always change as new revisions are introduced into the target branch... and you would see things that are not related to the work that was carried out in the source branch (which would make code review HELL) and it is definitely not what git will try to get into the target branch if you try to merge (the merge process involves comparing how the 2 branches have changed since they diverged so no point in checking the diff between the two tips of the branches).它会随时更改为新的修订版引入目标分支...你会看到相关到在源科(这将使代码审查HELL)开展的工作的事情,这绝不是什么如果您尝试合并,git 将尝试进入目标分支(合并过程涉及比较两个分支自发散以来的变化情况,因此检查分支的两个尖端之间的差异没有意义)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Azure DevOps 中拉取请求后挂钩或修改文件的任务 - Hook oder Task to modify files after pull request in Azure DevOps 在 Azure DevOps 上成功拉取请求后,维护与 bitbucket 同步的 Azure DevOps 存储库 - Maintaining an Azure DevOps repo in sync with bitbucket after a successful pull request on Azure DevOps cherry-picking 提交时遇到冲突。 Azure DevOps 中需要在本地执行此操作错误 - Encountered conflicts when cherry-picking commit . This operation needs to be performed locally error in Azure DevOps 无法在 Azure DevOps 上完成拉取请求 - Can't complete a Pull request on Azure DevOps 无法在 Azure DevOps 上完成拉取请求 - Can't complete pull request on Azure DevOps 在 Jenkins 中构建多 Azure DevOps 拉取请求 - Build Multi Azure DevOps Pull Request in Jenkins Azure DevOps 中的主动拉取请求中的块合并 - Block merges in active Pull Request in Azure DevOps Azure DevOps 解决拉取请求冲突 - Azure DevOps Resolve Pull Request Conflict 拉取请求后查看分支的变化 - Pull request seeing changes in branches after cherry-pick 即使在 Azure DevOps 中连接到项目后,也无法看到更改分支拉取请求同步 - Can't able to see Changes Branches Pull Request Sync even after connect to project in Azure DevOps
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM