美文网首页让前端飞Web前端之路
git rebase 修改commit message

git rebase 修改commit message

作者: 会会会会 | 来源:发表于2019-12-12 17:55 被阅读0次

    注意⚠️

    可以用git log看提交记录
    也可以配置(git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit”)
    就可以用git lg 查看

    注意⚠️


    image

    这是在rebasing中的意思,如果遇到什么问题

    直接git rebase --abort

    1. git rebase -i HEAD~3 (修改 最近三次的commit)


      image
    2. 接步骤1 ,按i(进入编辑)


      image
    1. 把你要改的commit节点的pick 改成 edit
    image
    ctrl+c,shift+q,然后wq退出,目前就选择了两个commit点进行rebase,
    所以下面会执行两次git commit --amend
    
    1. git commit --amend (进入修改界面)


      image

    然后wq退出

    1. git rebase --continue

    注意⚠开始️重复动作!

    1. git commit --amend(修改下一个选择的commit)
    image

    然后wq退出

    1. git rebase --continue
    image

    因为只有选了两个节点所以就完了

    1. git lg 查看修改成功没有
    image

    相关文章

      网友评论

        本文标题:git rebase 修改commit message

        本文链接:https://www.haomeiwen.com/subject/zcitnctx.html