How to edit commit messages?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to edit commit messages?

dr.chiarello
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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: How to edit commit messages?

Andreas Ericsson
[hidden email] 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                   [hidden email]
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: How to edit commit messages?

Miklos Vajna
In reply to this post by dr.chiarello
On Tue, Aug 12, 2008 at 02:38:32PM +0200, [hidden email] 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

attachment0 (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to edit commit messages?

Matthieu Moy
In reply to this post by dr.chiarello
[hidden email] 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html