2016-03-08 77 views
1

我一直在处理一个项目,其中所有提交的消息都是用西班牙语制作的。现在我正在和其他国家的人一起工作,所以我想将提交信息更改为英文。可能吗?将消息更改为已提交的提交

回答

2

是的,你将不得不做什么被称为“互动式基地”。这将允许您除其他外重写提交消息。

使用git log --topo-order --reverse找到第一个提交ID(它将是第一个),然后使用git rebase -i来重写所有提交消息。它看起来像这样。

$ git rebase -i <first commit ID> 

pick ea21ffd Version 2.13.1 
pick b98b956 Allow the extra_compiler_flags option to work. 
pick d096ee5 Fix "perl5i -e" from segfaulting. 
... 

# Rebase 42c49b0..d096ee5 onto 42c49b0 (3 command(s)) 
# 
# Commands: 
# p, pick = use commit 
# r, reword = use commit, but edit the commit message 
# e, edit = use commit, but stop for amending 
# s, squash = use commit, but meld into previous commit 
# f, fixup = like "squash", but discard this commit's log message 
# x, exec = run command (the rest of the line) using shell 
# d, drop = remove commit 
# 
# These lines can be re-ordered; they are executed from top to bottom. 

在你的情况,你会改变每pickreword

请参阅Pro Git中的Changing Multiple Commit Messages以获取有关执行交互式资源重置的更多信息。

注意,这样做你不改写历史,你创造新的历史记录。所有的提交ID都会改变。任何有签出代码的人都会在尝试推送和重新同步时遇到错误。请参阅Pro Git书中的The Perils Of Rebasing以获取更多信息。