V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
Livid
267.72D
571.85D
V2EX  ›  git

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

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

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

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

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