0
我有一個棘手的情況。我需要刪除並重新提交一些我已經推送到github remote repo的提交。但是這些提交不再是HEAD(人們把它們推到頂端)。刪除不是HEAD的遠程提交
我明白我可以恢復提交,因此保留提交歷史記錄。但要求是讓錯誤承諾消失。
所以:
D <- other people's commit
|
C <- B and C are wrong commits! They need to be removed
| <- The changes that should be preserved from B and C will be
B <- committed on top of D
|
A <- this was the initial state
給予更多的解釋,我使用的是2個不同的GitHub佔工作/個人。我意外地使用個人GitHub賬戶將B和C交給公司回購。所以,我需要從非員工賬戶中刪除這些提交