我有一个挤压问题。我已经审查了类似的问题,但似乎不合适。
当我处于git状态时,我得到:
Your branch is ahead of 'origin/mutual_19.2.1' by 2 commits.
当我做git log
时,它告诉我:
commit 9be1847ec8d9b472f99e362b266ec18fc73470dd
Merge: 67eb216 5bee872
Author: jsmith <john.smith@acme.com>
Date: Fri Feb 15 12:57:21 2019 -0500
Merge branch 'mutual_19.2.1' of ssh://cm1.mutual.us.vector.com:29418/Data_Delivery into Ticket_7503
Change-Id: I8d39d66d9d7a3933cb49bfc7f114e460aa141b5c
commit 67eb216fee18aecf6458a84bf9863901336b10a8
Author: jsmith <john.smith@acme.com>
Date: Fri Jan 4 09:53:15 2019 -0500
Mutual #7503 - Remove subscription grouping capabilities.
Change-Id: I8d39d66d9d7a3933cb49bfc7f114e460aa141b5c
这是我所期望的,它显示了我所做的冲突合并和我要推送的更改。按照我发现的壁球说明,我这样做:
git rebase -i HEAD~2
但是,这显示了我
pick 67eb216 Mutual #7503 - Remove subscription grouping capabilities.
pick 0749a12 Mutual #7330 - Made latency for PDA subscriptions editable.
pick 0ab8c6e Mutual #7504 - Close Subset dialog on subscription creation.
与上面几乎完全不同。
是什么原因导致的,我该如何压缩要压缩的提交?
答案 0 :(得分:1)
这是因为您的分支/分支没有与主/上游同步。
如果您正在使用叉子:
git fetch upstream
git rebase upstream/develop or git rebase upstream/master (which ever is the branch for which you want to make a pull request)
git push origin <your-branch-name> -f
如果您在同一存储库中的分支上工作:
git fetch origin
git rebase origin/develop or git rebase origin/master (which ever is the branch for which you want to make a pull request)
git push origin <your-branch-name> -f
然后执行git日志,然后git rebase -i HEAD〜2