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

Proposal to add a shortcut for --force-with-lease

From
vi0oss <vi0oss@gmail.com>
Date
Aug 20, 2016, 18:20 UTC
Message-ID
<57B89F83.8060001@gmail.com>

"--force" have currently two shortcuts: "-f" and "+", hence more ergonomic. But I expect it's better for users to use "--force-with-lease" by default for overriding remote branches (e.g. cleaning up a pull request), as it rarely fails in normal situations.

I propose adding some shortcut for "--force-with-lease".
Options for a shortcut:
* git push origin =HEAD:master
         "=" is like "+", but weaker ('+' being typed as shift+'=')
* git push -l origin HEAD:master
* git fpush origin HEAD:master

Unfortunately hijacking "-f" to mean "--force-with-lease" is not an option due to scripts. "-F" is also bad choice because of it looks like "-f" with even less checks (like "git checkout -B" instead of "-b").

Additionally, message when doing "git push -l" or "git push -nl" may show the range of commits being "thrown away".

Message 1 of 1 in “Proposal to add a shortcut for --force-with-lease”
  1. vi0ossAug 20, 2016

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.