I know in Git it's bad practice to push --force
. My understanding is that push --force-with-lease
is safe.
With that in mind, I have a question with three variants.
- Is it bad practice to
push --force-with-lease
on a branch on which only I add commits and for which there is no Merge Request open? - Is it bad practice if there is a Merge Request open for the branch?
- Is it bad practice if I know someone pulled it to review it locally?
If yes, could you please argument why? What are the practical implications that make this a bad practice, if they do?
In my mind, if it's clear to everyone that only I push to the branch, the only difference it makes to everybody else is that, after git fetch origin my-branch
and git checkout my-branch
, they have to git reset --hard origin/my-branch
instead of git merge
, which is slightly longer.
What pieces of the puzzle am I missing, if any?