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

Pushing an --amend-ed commit

From
RHRobert Haines <rhaines@manchester.ac.uk>
Date
Jun 2, 2008, 09:51 UTC
Message-ID
<6B355924-0EA9-4AF8-B051-F17FC4530495@manchester.ac.uk>
Hi list,
The other day I did the classic:
1) Right, changes all done and committed. Push to public repo.
2) Bugger, missed out an obvious one-liner in a Makefile. Make change  
and --amend that last commit.
3) Push to public repo again... Ah, "Not a strict subset" error, can't  
push...

It's obvious (I think) to me why I get this error - the commit now has a different hash so it looks like it would be the wrong thing to do to allow the push as far as git is concerned. Right?

So, is it safe to "use the --force" in this instance when pushing? This should just replace the old commit with the --amended commit with no side-effects, shouldn't it?

Thanks, Rob

-- 
Robert Haines

Research Associate, RealityGrid          Tel. : +44 (0)161 275 6067
Research Computing Services              Fax. : +44 (0)161 275 0637
University of Manchester                 Email: rhaines@manchester.ac.uk
Oxford Road                              Web  : www.realitygrid.org
Manchester, M13 9PL, UK                       : www.rcs.manchester.ac.uk
Next: Paolo Bonzini
Message 1 of 5 in “Pushing an --amend-ed commit”
  1. Robert HainesJun 2, 2008
  2. Paolo BonziniJun 2, 2008
  3. Robert HainesJun 3, 2008
  4. Matt PearsonJun 3, 2008
  5. Matt PearsonJun 3, 2008

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.