V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
rabbbit
V2EX  ›  问与答

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

  •  
  •   rabbbit · May 24, 2018 · 2190 views
    This topic created in 2895 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   ·   1015 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 19:03 · PVG 03:03 · LAX 12:03 · JFK 15:03
    ♥ Do have faith in what you're doing.