Ran into something weird with Git today ⊙.☉ I typed "git push -force-wth-lease" — had two mistakes: used a single "-" instead of "--", and even misspelled "with" as "wth". I was actually trying to run "git push --force-with-lease" and fully expected it to throw an error. But it didn’t. Git just picked up "-f" and went ahead with a force push 💀 Later found out why: Git treats single-dash flags loosely, so "-force-wth-lease" gets parsed like a bunch of short flags — and as soon as it sees "-f", it’s enough to trigger a force push. The rest is basically ignored. Kinda surprising how it still “works” even when the command is wrong. #git #devlife #programming #learning
Good insight
I guess someone got a PR to raise in Git repos