如何打开已经 force-push 的 PR (branch was force-pushed or recreated)
问题描述:
- 在 GitHub 上,我们关闭了 pull request,之后又向 PR 对应的分支 force push 了内容,导致 PR 无法重新打开,打开按钮是灰色的,如下图:
解决方案
- 记录本地(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
- 查看 GitHub 上已经关闭了的 PR 对应的 commit ID
- 强推本地分支的 commit ID 为 PR 对应的 commit ID,还原其关联关系
# git checkout fix-test-20190704 # git push -f origin 9cec2f17afd7cae08ca47e84a414c387338803cd:fix-test-20190704
- 回到 GitHub 页面,发现 Reopen 按钮已经可用
点击Reopen pull request
重新打开该 PR - 重新推送最新的更改(第一步记录的 commit ID)
# git push -f origin 03e4527a87986633c115030b90ab130f745f63d8:fix-test-20190704
如何打开已经 force-push 的 PR (branch was force-pushed or recreated)相关推荐
- 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 ...
- 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 ...
- gitlab 如何关闭force push
把不允许force push的分支设置成保护分支,Push的时候就会提示不能force psuh.
- 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 ...
- 报错 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 ...
- 【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 ...
- 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 出错 ...
- force complete tenting on top 与 force complete tenting on bottom (过孔)
"force complete tenting on top"与"force complete tenting on bottom"前面勾选上,就是要将焊盘和过 ...
- IDEA 【强制推送】(Force Push)为灰色不能点击 解决办法
1.需求说明 需要idea强制推送,不想每次都敲命令.但是idea的[强制推送]默认是禁用的,怎么办? git push -f 2.不废话,上结论 打开设置,删除手保护分支. 修改后可以用[强制推送] ...
最新文章
- Spring AOP实现原理解析
- java怎么播放不了声音,怎么在java application中播放声音
- 顶级程序员的心得ndash;Coders at Work
- WCF学习之旅—实现支持REST客户端应用(二十四)
- VB案例:多功能文本处理器
- python手机壁纸超清_【原创】Python必应超清壁纸爬虫
- 一步一步SharePoint 2007之四十一:实现Search(4)——设定爬网Schedule
- [乐意黎转载]GitHub上整理的一些工具集合
- 使用phaserjs开发简单h5小游戏
- 高德地图api中的adcode城市编码
- matlab图像的直方图,Matlab图像直方图相关函数
- 猿创征文|从单机百万tpmc到分布式千万tpmc,GaussDB性能提升的3个关键技术剖析
- 李克秋 加盟天津大学 计算机学院,17 天津大学
- 将两块球形橡皮泥揉在一起,捏成一个正方体。请编程,完成下述功能:从键盘读入2个球形橡皮泥的直径,直径为浮点数;求正方体的边长,并保留两位小数输出;
- jena mysql_使用Jena将本体存入MySQL
- Windows 2000进程细述.
- php药膳 源码,药膳
- 量化与码农 | 劝入vs劝退
- 马踏棋盘的问题——贪心算法
- 用JS获得QQ号码的昵称,头像,生日