【问题标题】:Change upstream pushed commit更改上游推送的提交
【发布时间】:2018-07-09 04:13:45
【问题描述】:

我有两个提交,并且都在 master commit new 和 commit old 中向上游推送。 他们俩都应该成为PR。提交旧应该做基础增强和提交两个添加一个功能。现在我需要添加一个修复来提交旧的。

我做了什么:

$ git rebase -i <commit_before_old>

应用了修复

$ git commit --all --amend --no-edit
$ git rebase --continue
$ git push -u orign master -f

但这不会改变 commit_old

【问题讨论】:

  • applied the fixes 什么修复了?你在交互式 rebase 窗口中输入了什么,你选择了哪些提交,压缩等等?

标签: git commit rebase


【解决方案1】:
git reset --hard commit_old

应用修复

git commit --all --amend --no-edit
git cherry-pick commit_new

根据需要解决冲突并提交

git push -u orign master -f

【讨论】:

    猜你喜欢
    • 2014-07-13
    • 1970-01-01
    • 2013-06-09
    • 2012-04-28
    • 1970-01-01
    • 1970-01-01
    • 2011-04-05
    • 2016-03-01
    • 2019-07-01
    相关资源
    最近更新 更多