如何删除旧提交中的信息而不删除'我最近的提交

时间:2016-08-04 08:26:46

标签: git

我有一个文件:

Crap + crap
Added R2 + crap
Added flags
Added MAE 

具有以下提交历史记录:

* commit 385ea04 (HEAD, master)
| Author: av376
| Date:   Thu Aug 4 03:56:26 2016 -0400
| 
|     Crap + crap
|  
* commit 9ba7feb
| Author: av376
| Date:   Thu Aug 4 02:37:50 2016 -0400
| 
|     Added R2 + crap
|  
* commit 56a7ee2
| Author: av376
| Date:   Thu Aug 4 02:36:14 2016 -0400
| 
|     Added flags.
|  
* commit 7189e56
  Author: av376
  Date:   Thu Aug 4 02:35:15 2016 -0400

提交注释指示添加到文件的内容。 我想要做的是修改我的git提交,以便获得以下git历史序列:

* commit 385ea04 (HEAD, master)
| Author: av376
| Date:   Thu Aug 4 03:56:26 2016 -0400
| 
|     Crap + crap
|  
* commit 9ba7feb
| Author: av376
| Date:   Thu Aug 4 02:37:50 2016 -0400
| 
|     Added R2
|  
* commit 56a7ee2
| Author: av376
| Date:   Thu Aug 4 02:36:14 2016 -0400
| 
|     Added flags.
|  
* commit 7189e56
  Author: av376
  Date:   Thu Aug 4 02:35:15 2016 -0400

我尝试过使用git rebase -i 9ba7feb ^(编辑),但在解决冲突后,我最终得到:

* commit 9ba7feb
| Author: av376
| Date:   Thu Aug 4 02:37:50 2016 -0400
| 
|     Added R2
|  
* commit 56a7ee2
| Author: av376
| Date:   Thu Aug 4 02:36:14 2016 -0400
| 
|     Added flags.
|  
* commit 7189e56
  Author: av376
  Date:   Thu Aug 4 02:35:15 2016 -0400

我最近的提交已经消失了。 为什么会这样? 有可能做我想要的吗? 如果是这样,怎么样? 我会非常感激地回答这些问题。

0 个答案:

没有答案