首页 > 其他分享 >git 指令

git 指令

时间:2023-03-03 17:58:48浏览次数:33  
标签:git 删除 Author Fri 指令 commit txt

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已经删除

标签:git,删除,Author,Fri,指令,commit,txt
From: https://www.cnblogs.com/caseyzq/p/17176486.html

相关文章