小编vij*_*jay的帖子

从 git 历史记录中删除并完全删除提交

我的 git 历史中有一个提交

1.commit 4930da17d8dd23d650ed38435d8b421816a0c451
  Date:   Sat Dec 5 14:34:18 2015 +0530

2.commit e1ebbbb599ee20ebec3ca92c26266d9fd16e7ccc
  Date:   Sat Dec 5 13:22:20 2015 +0530

3.commit 1c4a11a80eb054d24dafec2efed0b0282188e687
  Date:   Sat Dec 5 12:11:50 2015 +0530

4.commit b4ab3c164a3a8d93e0a71a94b5c561cb5e20ebf6
  Date:   Sat Dec 5 12:09:56 2015 +0530

5.commit 167b1d10258381f09663ce61fa88ce3bbcd404c4
  Date:   Sat Dec 5 12:09:21 2015 +0530

6.commit c61bcadac673e1c83f4c14b66d56e23b12fa3198
  Date:   Sat Dec 5 12:07:58 2015 +0530
Run Code Online (Sandbox Code Playgroud)

在第三次和第四次提交中包含错误的代码,但我在不知不觉中提交并推送了。

3.commit 1c4a11a80eb054d24dafec2efed0b0282188e687
  Date:   Sat Dec 5 12:11:50 2015 +0530

4.commit b4ab3c164a3a8d93e0a71a94b5c561cb5e20ebf6
  Date:   Sat Dec 5 12:09:56 2015 +0530
Run Code Online (Sandbox Code Playgroud)

但第五次和第六次提交包含正确的代码。我需要这个承诺才能工作。

5.commit 167b1d10258381f09663ce61fa88ce3bbcd404c4
  Date: …
Run Code Online (Sandbox Code Playgroud)

git push github post-commit git-commit

10
推荐指数
2
解决办法
2万
查看次数

标签 统计

git ×1

git-commit ×1

github ×1

post-commit ×1

push ×1