rabbbit
V2EX  ›  问与答

Git 写错 commit 描述且已经提交到 Github.除使用"amend 修改描述 重新 push"外,还有更好的解决办法吗?

  •  
  •   rabbbit · May 24, 2018 · 2497 views
    This topic created in 3103 days ago, the information mentioned may be changed or developed.

    以如下项目为例,我在提交到 Github 后才发现写错了描述.
    https://github.com/Aaron-Bird/dadda-translate-crx/network

    只好通过这两条命令修改

    git commit --amend -m "要修正的提交描述"
    git push origin master
    

    但这样做会导致提交记录凸出来一块

    只想改下提交描述,还有更好的解决办法吗?

    Supplement 1  ·  May 24, 2018
    漏了一条命令
    ```
    git commit --amend -m "要修正的提交描述"
    git pull origin master
    git push origin master
    ```
    sholmesian
    sholmesian
    May 24, 2018 via iPhone❤️1
    1
    git rebase -i head~2
    clino
    clino
    May 24, 2018❤️1
    2
    push -f 为什么会突出来一块?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   872 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 21:37 · PVG 05:37 · LAX 13:37 · JFK 16:37
    ♥ Do have faith in what you're doing.