git - Github Open Pull Requests
问题描述
I'd like to ask a question regarding Github, specifically pull requests.
Let's say for example that there is an open pull request.
I made a commit 'feat: add feature', and then a little while later someone else made a couple more commits to the pull request, 'feat: add feature b' and 'feat: add feature c', if I wanted to rename my original commit, is there a way to do that?
If I simply did something like git reset HEAD~
, would that ruin the two commits made after mine?
Thanks!
解决方案
您可以通过 重命名第一个提交interactive rebasing
。
如果头部有 3 个提交,请使用此命令
git rebase -i HEAD~3
这将打开这样的东西
pick a1beca Your commit
pick a2beca feat: add feature b
pick a3beca feat: add feature c
...
点击键盘上的“i”以激活交互模式。改写你的提交
reword a1beca Your commit
pick a2beca feat: add feature b
pick a3beca feat: add feature c
...
点击“esc”退出交互模式。然后:wq
这将要求您输入所需的提交消息。
欲了解更多信息,请阅读此处。一些练习会带你到那里。
推荐阅读
- c# - 例外:从“Amazon.Runtime.Internal.Util.MD5Stream”上的“位置”获取值时出错
- powershell - Powershell [ComponentModel.Win32Exception] 铸造不一致
- php - 无法访问数据库中的 Laravel 活动日志属性
- python - Python脚本从pycharm正确运行,但不能从批处理文件中运行
- c# - 如何使用 Line 从 C# 数据集中获取一个数组?
- excel - Power Query 中的滚动计数
- swift - 如何上传具有多个自动 ID 的新多个节点
- google-chrome - 如何使用注册表项禁用“始终在关联的应用程序中打开这些类型的链接”
- c# - 无法从类型转换
到 IType - django - Django Inlineformsets - 使用 django-extra-views 进行自定义验证