Git 功能分支从本地配置分支变基

问题描述 投票:0回答:1

我有一个存储库的 GitHub 分支,我有一个本地副本来实现功能。

该项目是一个多平台Flutter应用程序。它需要对其进行一些更改,以允许项目在我的计算机上构建,然后部署到我的测试设备。我不想将更改推送到 fork,这仅与我的本地配置有关。

我的工作流程是创建一个“本地配置”分支,进行必要的更改以在我的设备上运行,然后我创建另一个仅实现功能的分支,我们将其称为“功能分支”,然后对其进行测试,我将“本地配置”从“功能分支”变基。

要撤消变基,我使用

git rebase --onto master local-config feature-branch
。然后我可以推送到远程存储库,而无需混合配置更改。

这似乎工作正常一段时间,然后莫名其妙地无法构建并给出错误消息:

Could not build the precompiled application for the device.
Uncategorized (Xcode): Could not resolve package dependencies:
  downloaded archive of binary target 'GoogleAppMeasurementIdentitySupport' from
  'https://dl.google.com/firebase/ios/swiftpm/10.24.0/GoogleAppMeasurementIdenti
  tySupport.zip' does not contain a binary artifact.
  downloaded archive of binary target 'grpcpp' from
  'https://dl.google.com/firebase/ios/bin/grpc/1.62.2/rc0/grpcpp.zip' does not
  contain a binary artifact.
  fatalError




Error launching application on iPhone.

它仍将构建在“local-config”分支上。只是不在“功能分支”上。

ios flutter xcode git github
1个回答
0
投票

为此设置两个分支并在交付之前重新设置基准的方法是绝对正确的方法。唯一需要注意的是,变基可能会删除导致提交无法成功构建/运行测试的隐式依赖关系1,对我来说似乎就是这种情况?

解决此问题的方法是在变基后测试每个提交,为此使用的工具是git test,它可以让您在一系列提交上迭代测试。


1 让我指出,这不是 rebase 独有的,这也可能发生在 git cherry-pick 甚至

git add -p
上。
    

© www.soinside.com 2019 - 2024. All rights reserved.