# How to edit commit messages?

4 messages from 2008-08-12 to 2008-08-12. Participants: dr.chiarello@gmail.com, Miklos Vajna, Andreas Ericsson, Matthieu Moy.
Thread: https://gitlist.dev/t/14957

## dr.chiarello@gmail.com, 2008-08-12 12:38

Subject: How to edit commit messages?
Message-ID: <g7s088$o1p$1@ger.gmane.org>
URL: https://gitlist.dev/e/g7s088%24o1p%241%40ger.gmane.org

```
Hi all,
  what are the best solution to:
1) interactively edit commit's messages (some or all)
2) batch edit commit's messages (for example using sed)

My repo is not published yet, so there is no problem in rewriting all
history.

Thanks in advance

```

## Andreas Ericsson, 2008-08-12 12:45

Subject: Re: How to edit commit messages?
Message-ID: <48A185D0.3070003@op5.se>
URL: https://gitlist.dev/e/48A185D0.3070003%40op5.se
In-Reply-To: <g7s088$o1p$1@ger.gmane.org>

```
dr.chiarello@gmail.com wrote:
> Hi all,
>   what are the best solution to:
> 1) interactively edit commit's messages (some or all)
> 2) batch edit commit's messages (for example using sed)
> 
> My repo is not published yet, so there is no problem in rewriting all
> history.
> 

git filter-branch --msg-filter 'sed s/foo/bar/g' master

to replace all occurrences of foo with bar in all commit
messages for all commits made on the master branch.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

```

## Miklos Vajna, 2008-08-12 12:45

Subject: Re: How to edit commit messages?
Message-ID: <20080812124557.GB18960@genesis.frugalware.org>
URL: https://gitlist.dev/e/20080812124557.GB18960%40genesis.frugalware.org
In-Reply-To: <g7s088$o1p$1@ger.gmane.org>

```
On Tue, Aug 12, 2008 at 02:38:32PM +0200, dr.chiarello@gmail.com wrote:
> 1) interactively edit commit's messages (some or all)

git rebase -i

> 2) batch edit commit's messages (for example using sed)

git filter-branch

```

## Matthieu Moy, 2008-08-12 12:49

Subject: Re: How to edit commit messages?
Message-ID: <vpqd4kepfde.fsf@bauges.imag.fr>
URL: https://gitlist.dev/e/vpqd4kepfde.fsf%40bauges.imag.fr
In-Reply-To: <g7s088$o1p$1@ger.gmane.org>

```
dr.chiarello@gmail.com writes:

> Hi all,
>   what are the best solution to:
> 1) interactively edit commit's messages (some or all)

  git rebase -i

can help.

> 2) batch edit commit's messages (for example using sed)

  git filter-branch --msg-filter sed 's/foo/bar/'

should do it.

-- 
Matthieu

```
