Home  >  Q&A  >  body text

git commit -m ""内容写错,如何重新编辑

已经 git commit -m "",但是备注内容写错了,如何修改备注的信息

某草草某草草2727 days ago1030

reply all(4)I'll reply

  • 黄舟

    黄舟2017-05-02 09:23:12

    You can edit it again: git commit --amend
    Or reset it and start againgit reset --hard HEAD^

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-02 09:23:12

    git commit --amend

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-02 09:23:12

    commit provides a --amend parameter, which can modify the last submitted information

    reply
    0
  • PHP中文网

    PHP中文网2017-05-02 09:23:12

    If you find after git commit that the commit information was written incorrectly or some files were forgotten to submit, and no push has been performed after the commit, you can use git commit --amend to modify this commit

    git commit -m 'initial commit'
    git add ./README.md
    git commit --amend
    The above three commands ultimately only produce one commit, and the second commit command modifies the content of the first commit.
    http://git.oschina.net/progit/2-Git-%E5%9F%BA%E7%A1%80.html#2.4-%E6%92...

    reply
    0
  • Cancelreply