git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-commit --amend -m "..." complains?!?

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 1, 2007, 17:18 UTC
Message-ID
<7v8x8v5g2z.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<86643znxgz.fsf@lola.quinscape.zz>
David Kastrup <dak@gnu.org> writes:
Show 7 quoted lines
> I get
>
> Option -m cannot be combined with -c/-C/-F/--amend.
>
> but that makes no sense: of course there is ample reason for providing
> an amended commit message on the command line.  -c, -C and -F indeed
> all provide an alternative commit message, but --amend doesn't.

The option --amend is about "reusing the original commit message and make amending edit on top". If you are restarting the message from scratch, --amend does not make much sense.

You can do:
	$ git reset HEAD^
        $ git commit -m "blah"
if you do not want to reuse the commit message.
Previous: David KastrupNext: David Kastrup
Message 2 of 7 in “git-commit --amend -m "..." complains?!?”
  1. David KastrupAug 1, 2007
  2. Junio C HamanoAug 1, 2007
  3. David KastrupAug 1, 2007
  4. Junio C HamanoAug 1, 2007
  5. David KastrupAug 1, 2007
  6. git-commit.sh: Permit the --amend message to be given with -m/-c/-C/-F.David Kastrup, Aug 1, 2007
  7. Junio C HamanoAug 2, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.