git - 如何重新设置分叉的本地分支?
问题描述
我分叉了一个开源项目。然后我在本地 git 中创建了那个 fork 的副本。
当我想变基时(我不知道这是否是一个好方法,但它确实有效):
git checkout main
git fetch project-name
git reset --project-name/main (This make my local like the upstream)
git push --force-with-lease (this makes my forked like the local)
现在,说我做到了:
git checkout mybranch
git commit
git push....
我将更改推送到我的 fork 并打开了上游项目的 PR。我被要求用最新的 PR 重新设置我的 PR,main
因为我的分支落后了 100 多个提交,但我不知道该怎么做。
我的问题是我现在如何可以使用 rebase或者更喜欢 rebase mybranch
with 然后 rebase with ?upstream/main
main
upstream/main
my_branch
main
解决方案
推荐阅读
- mongodb - 将空列与具有值的列相加
- angular - RxJS:如何触发 2 个并行请求,其中一个是可选的,超时
- php - 如何使用模态获取多值复选框
- c++ - 具有在语法树中的节点上定义的层次结构的表达式模板
- python - 熊猫所有以前日期的累计总和(按组)
- javascript - LazyLoad 自定义 CSS 砌体网格
- android - 我的邮递员 base64 编码字符串抛出“MessageTooBig”错误
- laravel - 如何更改自定义 FormRequest 的 http 响应状态?
- ffmpeg - FFmpeg drawtext 和使用 sendcmd/zmq 的实时坐标
- html - 引导程序 4:添加行或添加 col-12 之间的区别?