git
› Pro Git
› Atlassian Git Tutorial
› Pro Git 简体中文翻译
› GitX
Livid
403.84D
566.55D
V2EX  ›  git

git 里是否可以修改一条很久之前的 commit 的 message 呢?

  •  
  •   Livid ·
    PRO
    · Apr 20, 2012 · 14837 views
    This topic created in 5312 days ago, the information mentioned may be changed or developed.
    完美综合症……看到一个 typo 实在是很想改掉。
    5 replies  •  1970-01-01 08:00:00 +08:00
    goool
    goool
    Apr 21, 2012 via iPad❤️1
    2
    Changing Your Commit Messages http://schacon.github.com/history.html
    kongruxi
    kongruxi
    Apr 21, 2012
    4
    如果git库是和多人共享的,并且这个提交已经push了,不要修改了,否则是灾难性的,如果只是一个人用,就没有问题

    rebase -i 应该可以解决你的问题,不过,如果你有部分提交是刻意用参数--no-ff来merge的话,rebase之后会那些分叉就会消失了
    ant_sz
    ant_sz
    Apr 21, 2012
    5
    大杀器,filter-branch 神马的

    http://progit.org/book/zh/ch6-4.html

    更改任意历史前的提交,然后git会逐一扫描这个branch的每一个提交,以便于修复冲突
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1297 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 21:33 · PVG 05:33 · LAX 13:33 · JFK 16:33
    ♥ Do have faith in what you're doing.