git删除中间某些commit提交点
git log获取commit信息
commit 58211e7a5da5e74171e90d8b90b2f00881a48d3a
Author: test <[email protected]>
Date: Fri Sep 22 20:55:38 2017 +0800
add d.txt
commit 0fb295fe0e0276f0c81df61c4fd853b7a000bb5c
Author: test <[email protected]>
Date: Fri Sep 22 20:32:45 2017 +0800
add c.txt
commit 7753f40d892a8e0d14176a42f6e12ae0179a3210
Author: test <[email protected]>
Date: Fri Sep 22 20:31:39 2017 +0800
init
如果想要删除中间add c.txt commit 0fb295fe0e0276f0c81df61c4fd853b7a000bb5c这笔提交
1.首先找到要删除的commit的前一次提交记录
2.
git rebase -i (commit-id)
3.编译弹出的文件,将需要删除的commit前的pick--->drop,然后保存退出
4.git log查看,目标commit已经删除