git

git 删除历史推送记录

删除941a06e201f2ba的历史推送

git log –oneline

1
2
3
4
5
6
7
8
9
10
11
12
13
ffd9347 (HEAD -> master, origin/master, origin/HEAD) update
201f2ba 遞歸上傳
530164e readmd5
4439a3d readmd5
388ce97 update
b88bbc3 goscp
550a13a ssh rsync
4ed01ab iptables
476ddf9 iptable
e02b0b5 iptable
0a58703 oo
941a06e robotgo
9bb5277 nginx

git rebase -i 941a06e

1
2
3
4
5
6
7
8
9
10
11
12
13
1 pick 0a58703 oo
2 pick e02b0b5 iptable
3 pick 476ddf9 iptable
4 pick 4ed01ab iptables
5 pick 550a13a ssh rsync
6 pick b88bbc3 goscp
7 pick 388ce97 update
8 pick 4439a3d readmd5
9 pick 530164e readmd5
10 pick 201f2ba 遞歸上傳
11 pick ffd9347 update
12
13 # 变基 941a06e..ffd9347 到 941a06e(11 个提交)

:1,10s/pick/drop/g
:wq

1
2
3
4
5
6
7
8
9
10
11
1 drop 0a58703 oo
2 drop e02b0b5 iptable
3 drop 476ddf9 iptable
4 drop 4ed01ab iptables
5 drop 550a13a ssh rsync
6 drop b88bbc3 goscp
7 drop 388ce97 update
8 drop 4439a3d readmd5
9 drop 530164e readmd5
10 drop 201f2ba 遞歸上傳
11 pick ffd9347 update

git push –force

推荐文章