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

Question: is there a possibility of getting a warning before a git push -f

From
Aditya Garg <gargaditya08@live.com>
Date
Jun 9, 2025, 16:46 UTC
Message-ID
<PN0PR01MB95880EAA98466C9AB049BA44B86BA@PN0PR01MB9588.INDPRD01.PROD.OUTLOOK.COM>
One thing I sometimes encounter is that I sometimes git push -f and moments later I realise I did it at the wrong time, result being a disaster. I was wondering if a little [y/N] warning could be possible before the risky command gets executed. I saw the code for push superficially and I don't think it's implemented. I think it would be a nice feature though.
Next: Junio C Hamano
Message 1 of 5 in “Question: is there a possibility of getting a warning before a git push -f”
  1. Aditya GargJun 9, 2025
  2. Junio C HamanoJun 9, 2025
  3. Aditya GargJun 9, 2025
  4. D. Ben KnobleJun 11, 2025
  5. Aditya GargJun 12, 2025

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.