问题描述:

  • 在 GitHub 上,我们关闭了 pull request,之后又向 PR 对应的分支 force push 了内容,导致 PR 无法重新打开,打开按钮是灰色的,如下图:

解决方案

  1. 记录本地(force-push 之后)PR 分支的 commit ID
    这里实验分支名为 fix-test-20190704,实际操作时需要换成你的 PR 对应的分支

    # git log --oneline -1 fix-test-20190704
    03e4527a87 (HEAD -> fix-test-20190704 origin/fix-test-20190704) some comments
    
  2. 查看 GitHub 上已经关闭了的 PR 对应的 commit ID
  3. 强推本地分支的 commit ID 为 PR 对应的 commit ID,还原其关联关系
    # git checkout fix-test-20190704
    # git push -f origin 9cec2f17afd7cae08ca47e84a414c387338803cd:fix-test-20190704
    
  4. 回到 GitHub 页面,发现 Reopen 按钮已经可用

    点击 Reopen pull request 重新打开该 PR
  5. 重新推送最新的更改(第一步记录的 commit ID)
    # git push -f origin 03e4527a87986633c115030b90ab130f745f63d8:fix-test-20190704
    

如何打开已经 force-push 的 PR (branch was force-pushed or recreated)相关推荐

  1. git 本地新建分支上传报错The current branch dev has no upstream branch.To push the current branch and setremote

    项目本地初始化后,commit执行完毕,然后执行git push,报如下错误: $ git push fatal: The current branch dev has no upstream bra ...

  2. fatal: The current branch dev has no upstream branch. To push the current branch and set the remote

    fatal: The current branch dev has no upstream branch. To push the current branch and set the remote ...

  3. gitlab 如何关闭force push

    把不允许force push的分支设置成保护分支,Push的时候就会提示不能force psuh.

  4. fatal: The current branch xiao has no upstream branch. To push the current branch and set the remote

    场景: 使用git 的时候,git push 然后提示我以下错误 $ git pushfatal: The current branch xiao has no upstream branch.To ...

  5. 报错 fatal: The current branch html has no upstream branch. To push the current branch and set the

    场景: 远程上有已存在的项目的后端代码,想要把这个项目的前端代码推送上去. 做的步骤: 1.git status 2. git add . 注意add和.之间有空格 3.git commit - m ...

  6. 【git报错】The current branch dev has no upstream branch. To push the current branch and set the remote

    发现问题 本地新建了一个dev分支,然后把dev分支下的代码push到远程仓库中,使用git push,但是报错了,如下: fatal: The current branch dev has no u ...

  7. idea集成git-push报错push of current branch was rejected remote changes need to be merged before pushing

    合并提交出现问题 问题 push of current branch was rejected remote changes need to be merged before pushing ​ 出错 ...

  8. force complete tenting on top 与 force complete tenting on bottom (过孔)

    "force complete tenting on top"与"force complete tenting on bottom"前面勾选上,就是要将焊盘和过 ...

  9. IDEA 【强制推送】(Force Push)为灰色不能点击 解决办法

    1.需求说明 需要idea强制推送,不想每次都敲命令.但是idea的[强制推送]默认是禁用的,怎么办? git push -f 2.不废话,上结论 打开设置,删除手保护分支. 修改后可以用[强制推送] ...

最新文章

  1. Spring AOP实现原理解析
  2. java怎么播放不了声音,怎么在java application中播放声音
  3. 顶级程序员的心得ndash;Coders at Work
  4. WCF学习之旅—实现支持REST客户端应用(二十四)
  5. VB案例:多功能文本处理器
  6. python手机壁纸超清_【原创】Python必应超清壁纸爬虫
  7. 一步一步SharePoint 2007之四十一:实现Search(4)——设定爬网Schedule
  8. [乐意黎转载]GitHub上整理的一些工具集合
  9. 使用phaserjs开发简单h5小游戏
  10. 高德地图api中的adcode城市编码
  11. matlab图像的直方图,Matlab图像直方图相关函数
  12. 猿创征文|从单机百万tpmc到分布式千万tpmc,GaussDB性能提升的3个关键技术剖析
  13. 李克秋 加盟天津大学 计算机学院,17 天津大学
  14. 将两块球形橡皮泥揉在一起,捏成一个正方体。请编程,完成下述功能:从键盘读入2个球形橡皮泥的直径,直径为浮点数;求正方体的边长,并保留两位小数输出;
  15. jena mysql_使用Jena将本体存入MySQL
  16. Windows 2000进程细述.
  17. php药膳 源码,药膳
  18. 量化与码农 | 劝入vs劝退
  19. 马踏棋盘的问题——贪心算法
  20. 用JS获得QQ号码的昵称,头像,生日

热门文章

  1. Lambda表达式语法 (二)
  2. 《庄子·外篇·骈拇第八》
  3. 大学生应对面试宝典(电话、现场面试)
  4. Spark RDD 论文详解(三)Spark 编程接口
  5. 126篇殿堂级深度学习论文分类整理,从入门到应用
  6. 谷歌发布史上“最强大脑”——可以控制和操作机器人的AI模型
  7. 外行对程序员误会有多深!扎心了!
  8. 昨晚深夜听到清青门前有个女生在哭
  9. python爬取哔哩哔哩网站数据以及弹幕
  10. Windows11 文件管理器 很慢很卡怎么办