rabbbit
V2EX  ›  问与答

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

  •  
  •   rabbbit · May 24, 2018 · 2233 views
    This topic created in 2914 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
        1
    sholmesian  
       May 24, 2018 via iPhone   ❤️ 1
    git rebase -i head~2
    clino
        2
    clino  
       May 24, 2018   ❤️ 1
    push -f 为什么会突出来一块?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3057 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 06:21 · PVG 14:21 · LAX 23:21 · JFK 02:21
    ♥ Do have faith in what you're doing.