当前位置:   article > 正文

Git修改历史的某次提交_git 重新编辑某次提交的内容

git 重新编辑某次提交的内容

Git使用中,如果遇到某一次的提交不满意,可以使用如下方法修改


# git rebase -i HEAD~3  >>> HEAD~3表示列出最近三次的

之后会出现

  1. 1 pick 6e1bb94 modify
  2. 2 pick 1769e78 delete
  3. 3 pick 7ce9cad delete
  4. 4
  5. 5 # Rebase 491ed3f..7ce9cad onto 491ed3f
  6. 6 #
  7. 7 # Commands:
  8. 8 # p, pick = use commit
  9. 9 # r, reword = use commit, but edit the commit message
  10. 10 # e, edit = use commit, but stop for amending
  11. 11 # s, squash = use commit, but meld into previous commit
  12. 12 # f, fixup = like "squash", but discard this commit's log message
  13. 13 # x, exec = run command (the rest of the line) using shell
  14. 14 #
  15. 15 # These lines can be re-ordered; they are executed from top to bottom.
  16. 16 #
  17. 17 # If you remove a line here THAT COMMIT WILL BE LOST.
  18. 18 # However, if you remove
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/运维做开发/article/detail/940594
推荐阅读
相关标签
  

闽ICP备14008679号