Re: Short form of --force-with-lease
- From
Kipras Melnikovas <kipras@kipras.org>
- Date
- Apr 12, 2024, 09:00 UTC
- Message-ID
- <20240412090035.87612-2-kipras@kipras.org>
- In-Reply-To
- <CAO_smVhB0QUomdSxGqwvFKrb53NGMZE+y=3zbRnQX+ciLRZyOw@mail.gmail.com>
Show 18 quoted lines
> > > If this is mostly about saving typing, you could get a similar effect adding > > > an alias. Something like > > > > > > git config --global alias.pushfl 'push --force-with-lease' > > > > Correct, and I already have an alias: > > 'pf = push --force-with-lease --force-if-includes'. > > > > However, I see the config option more valuable - it would protect against > > accidental `push -f`, which, out of habit, is very probable to run on accident. > > With the config option, would feel safe and wouldn't need the alias either. > > It would normalize the use of `push -f` in people's muscle memory, > which would be a potential disaster if someone lost their > configuration, but not this muscle memory. It also would break > automation/scripts - `git push` is likely used by both humans and > automation <...>. A separate flag (or just using an alias if it's for > saving typing) would be safer.
Fair point, I retract my config option proposal. A separate flag, as proposed by OP, would make more sense. Thanks.